Class SampleWithFraction<T>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.RichMapPartitionFunction<T,T>
-
- org.apache.flink.api.java.functions.SampleWithFraction<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.MapPartitionFunction<T,T>,org.apache.flink.api.common.functions.RichFunction
@Internal public class SampleWithFraction<T> extends org.apache.flink.api.common.functions.RichMapPartitionFunction<T,T>A map partition function wrapper for sampling algorithms with fraction, the sample algorithm takes the partition iterator as input.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SampleWithFraction(boolean withReplacement, double fraction, long seed)Create a function instance of SampleWithFraction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmapPartition(Iterable<T> values, org.apache.flink.util.Collector<T> out)
-
-
-
Constructor Detail
-
SampleWithFraction
public SampleWithFraction(boolean withReplacement, double fraction, long seed)Create a function instance of SampleWithFraction.- Parameters:
withReplacement- Whether element can be selected more than once.fraction- Probability that each element is selected.seed- random number generator seed.
-
-