Class PiEstimation.Sampler

  • All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.MapFunction<Long,​Long>
    Enclosing class:
    PiEstimation

    public static class PiEstimation.Sampler
    extends Object
    implements org.apache.flink.api.common.functions.MapFunction<Long,​Long>
    Sampler randomly emits points that fall within a square of edge x * y. It calculates the distance to the center of a virtually centered circle of radius x = y = 1 If the distance is less than 1, then and only then does it returns a 1.
    See Also:
    Serialized Form
    • Constructor Detail

      • Sampler

        public Sampler()
    • Method Detail

      • map

        public Long map​(Long value)
        Specified by:
        map in interface org.apache.flink.api.common.functions.MapFunction<Long,​Long>