public class DeterministicTaskPartitioner extends java.lang.Object implements TaskPartitioner
Constructor and Description |
---|
DeterministicTaskPartitioner() |
Modifier and Type | Method and Description |
---|---|
void |
commit(int source,
int partition)
Indicate that we are using this partition
|
int |
partition(int source,
java.lang.Object data)
Get a partition id, it should be from the set of
destinations |
void |
prepare(java.util.Set sources,
java.util.Set destinations)
Prepare the partition with sources and destinations.
|
public void prepare(java.util.Set sources, java.util.Set destinations)
TaskPartitioner
prepare
in interface TaskPartitioner
public int partition(int source, java.lang.Object data)
TaskPartitioner
destinations
partition
in interface TaskPartitioner
source
- source of the datadata
- data to be partitionedpublic void commit(int source, int partition)
TaskPartitioner
commit
in interface TaskPartitioner
source
- source of the partitionpartition
- partition to commit