public class HashingPartitioner<T> extends java.lang.Object implements PartitionFunc<T>
Constructor and Description |
---|
HashingPartitioner() |
Modifier and Type | Method and Description |
---|---|
void |
commit(int source,
int partition)
Commit the partition
|
int |
partition(int sourceIndex,
T val)
Computes the partition for the given key.
|
void |
prepare(java.util.Set<java.lang.Integer> sources,
java.util.Set<java.lang.Integer> dests)
Prepare the function
|
public void prepare(java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> dests)
PartitionFunc
prepare
in interface TaskPartitioner<T>
prepare
in interface PartitionFunc<T>
sources
- sourcedests
- destinationspublic int partition(int sourceIndex, T val)
PartitionFunc
partition
in interface TaskPartitioner<T>
partition
in interface PartitionFunc<T>
sourceIndex
- source of the dataval
- value.public void commit(int source, int partition)
PartitionFunc
commit
in interface TaskPartitioner<T>
commit
in interface PartitionFunc<T>
source
- the sourcepartition
- partition