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) |
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContextpublic 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>>ExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.