T
- The type of input data@Internal public class SampleInPartition<T> extends org.apache.flink.api.common.functions.RichMapPartitionFunction<T,IntermediateSampleData<T>>
Constructor and Description |
---|
SampleInPartition(boolean withReplacement,
int numSample,
long seed)
Create a function instance of SampleInPartition.
|
Modifier and Type | Method and Description |
---|---|
void |
mapPartition(Iterable<T> values,
org.apache.flink.util.Collector<IntermediateSampleData<T>> out) |
public SampleInPartition(boolean withReplacement, int numSample, long seed)
withReplacement
- Whether element can be selected more than once.numSample
- Fixed sample size.seed
- Random generator seed.public void mapPartition(Iterable<T> values, org.apache.flink.util.Collector<IntermediateSampleData<T>> out) throws Exception
mapPartition
in interface org.apache.flink.api.common.functions.MapPartitionFunction<T,IntermediateSampleData<T>>
mapPartition
in class org.apache.flink.api.common.functions.RichMapPartitionFunction<T,IntermediateSampleData<T>>
Exception
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.