T - The input data type.@Internal public abstract class DistributedRandomSampler<T> extends RandomSampler<T>
| Modifier and Type | Field and Description | 
|---|---|
| protected Iterator<IntermediateSampleData<T>> | emptyIntermediateIterable | 
| protected int | numSamples | 
emptyIterable, EPSILON| Constructor and Description | 
|---|
| DistributedRandomSampler(int numSamples) | 
| Modifier and Type | Method and Description | 
|---|---|
| Iterator<T> | sample(Iterator<T> input)Combine the first phase and second phase in sequence, implemented for test purpose only. | 
| Iterator<T> | sampleInCoordinator(Iterator<IntermediateSampleData<T>> input)Sample algorithm for the second phase. | 
| abstract Iterator<IntermediateSampleData<T>> | sampleInPartition(Iterator<T> input)Sample algorithm for the first phase. | 
protected final int numSamples
protected final Iterator<IntermediateSampleData<T>> emptyIntermediateIterable
public abstract Iterator<IntermediateSampleData<T>> sampleInPartition(Iterator<T> input)
input - The DataSet input of each partition.public Iterator<T> sampleInCoordinator(Iterator<IntermediateSampleData<T>> input)
input - The intermediate sample output generated in the first phase.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.