public class DefaultDestinationSelector extends java.lang.Object implements DestinationSelector
Constructor and Description |
---|
DefaultDestinationSelector(TaskPartitioner partitioner,
java.util.Map<java.lang.Integer,java.lang.Integer> srcGlobalToIndex,
java.util.Map<java.lang.Integer,java.lang.Integer> tgtsGlobalToIndex) |
Modifier and Type | Method and Description |
---|---|
void |
commit(int source,
int next)
Say that we have used the obtained destination
|
int |
next(int source,
java.lang.Object data)
Get next destination using source and the data
|
int |
next(int source,
java.lang.Object key,
java.lang.Object data)
Get next destination using source, key and data
|
void |
prepare(Communicator comm,
java.util.Set<java.lang.Integer> sources,
java.util.Set<java.lang.Integer> destinations)
Prepare the destination selector
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
prepare
public DefaultDestinationSelector(TaskPartitioner partitioner, java.util.Map<java.lang.Integer,java.lang.Integer> srcGlobalToIndex, java.util.Map<java.lang.Integer,java.lang.Integer> tgtsGlobalToIndex)
public void prepare(Communicator comm, java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> destinations)
DestinationSelector
prepare
in interface DestinationSelector
comm
- the communicatorsources
- sourcesdestinations
- destinationpublic int next(int source, java.lang.Object data)
DestinationSelector
next
in interface DestinationSelector
source
- sourcedata
- datapublic void commit(int source, int next)
DestinationSelector
commit
in interface DestinationSelector
source
- sourcenext
- obtained destinationpublic int next(int source, java.lang.Object key, java.lang.Object data)
DestinationSelector
next
in interface DestinationSelector
source
- sourcekey
- keydata
- data