T
- The input data type.public abstract class DistributedRandomSampler<T> extends RandomSampler<T>
Modifier and Type | Field and Description |
---|---|
protected Iterator<IntermediateSampleData<T>> |
EMPTY_INTERMEDIATE_ITERABLE |
protected int |
numSamples |
EMPTY_ITERABLE, 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>> EMPTY_INTERMEDIATE_ITERABLE
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–2015 The Apache Software Foundation. All rights reserved.