T - the data type wrapped in ElementWithRandom as input.@Internal public class SampleInCoordinator<T> extends Object implements GroupReduceFunction<IntermediateSampleData<T>,T>
| Constructor and Description |
|---|
SampleInCoordinator(boolean withReplacement,
int numSample,
long seed)
Create a function instance of SampleInCoordinator.
|
public SampleInCoordinator(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 reduce(Iterable<IntermediateSampleData<T>> values, Collector<T> out) throws Exception
reduce in interface GroupReduceFunction<IntermediateSampleData<T>,T>ExceptionCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.