public interface TaskPartitioner<T>
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
void |
commit(int source,
int partition)
Indicate that we are using this partition
|
int |
partition(int source,
T 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.
|
void prepare(java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> destinations)
int partition(int source, T data)
destinations
source
- source of the datadata
- data to be partitionedvoid commit(int source, int partition)
source
- source of the partitionpartition
- partition to commit