public class TaskPartitionerForSampledData extends TaskPartitionerForRandom
destinationsList, keysToOneTask
Constructor and Description |
---|
TaskPartitionerForSampledData(byte[] minMax,
int keySize) |
Modifier and Type | Method and Description |
---|---|
protected int |
getIndex(byte[] array) |
int |
partition(int source,
byte[] data)
Get a partition id, it should be from the set of
destinations |
void |
prepare(java.util.Set<java.lang.Integer> sources,
java.util.Set<java.lang.Integer> destinations)
Prepare the partition with sources and destinations.
|
commit
public TaskPartitionerForSampledData(byte[] minMax, int keySize)
public void prepare(java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> destinations)
TaskPartitioner
prepare
in interface TaskPartitioner<byte[]>
prepare
in class TaskPartitionerForRandom
protected int getIndex(byte[] array)
getIndex
in class TaskPartitionerForRandom
public int partition(int source, byte[] data)
TaskPartitioner
destinations
partition
in interface TaskPartitioner<byte[]>
partition
in class TaskPartitionerForRandom
source
- source of the datadata
- data to be partitioned