public class HashingSelector extends java.lang.Object implements DestinationSelector
Constructor and Description |
---|
HashingSelector() |
Modifier and Type | Method and Description |
---|---|
void |
commit(int source,
int dest)
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> dests)
Prepare the destination selector
|
void |
prepare(Communicator comm,
java.util.Set<java.lang.Integer> sources,
java.util.Set<java.lang.Integer> dests,
MessageType kType,
MessageType dType)
Prepare the destination selector, if this method is not overridden to support keyType
and dataType those values will be simply discarded.
|
public void prepare(Communicator comm, java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> dests)
DestinationSelector
prepare
in interface DestinationSelector
comm
- the communicatorsources
- sourcesdests
- destinationpublic void prepare(Communicator comm, java.util.Set<java.lang.Integer> sources, java.util.Set<java.lang.Integer> dests, MessageType kType, MessageType dType)
DestinationSelector
prepare
in interface DestinationSelector
comm
- the communicatorsources
- sourcesdests
- destinationkType
- type of key that this selector handlesdType
- type of data that this selector handlespublic int next(int source, java.lang.Object key, java.lang.Object data)
DestinationSelector
next
in interface DestinationSelector
source
- sourcekey
- keydata
- datapublic int next(int source, java.lang.Object data)
DestinationSelector
next
in interface DestinationSelector
source
- sourcedata
- datapublic void commit(int source, int dest)
DestinationSelector
commit
in interface DestinationSelector
source
- sourcedest
- obtained destination