public class OneToOnePartitioner<T> extends java.lang.Object implements PartitionFunc<T>
| Constructor and Description |
|---|
OneToOnePartitioner() |
| 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> srcs,
java.util.Set<java.lang.Integer> dests)
Prepare the function
|
public void prepare(java.util.Set<java.lang.Integer> srcs,
java.util.Set<java.lang.Integer> dests)
PartitionFuncprepare in interface TaskPartitioner<T>prepare in interface PartitionFunc<T>srcs - sourcedests - destinationspublic int partition(int sourceIndex,
T val)
PartitionFuncpartition in interface TaskPartitioner<T>partition in interface PartitionFunc<T>sourceIndex - source of the dataval - value.public void commit(int source,
int partition)
PartitionFunccommit in interface TaskPartitioner<T>commit in interface PartitionFunc<T>source - the sourcepartition - partition