public abstract class TargetFinalReceiver extends TargetReceiver
| Modifier and Type | Field and Description |
|---|---|
protected <any> |
barriers
The barriers for each target
|
protected boolean |
stateCleared
State is cleared
|
protected java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> |
syncReceived
Keep weather we have received a sync from a source
|
protected <any> |
targetStates
Keep state about the targets
|
destination, groupingSize, highWaterMark, lock, messages, operation, representSource, syncState, targets, thisDestinations, thisSources, workerId| Constructor and Description |
|---|
TargetFinalReceiver() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSyncMessage(int source,
int target)
Add a sync message
|
protected void |
addSyncMessageBarrier(int source,
int target,
byte[] barrier)
Add a sync message
|
protected boolean |
canAcceptMessage(int source,
int target)
Check weather we can accept a message
|
void |
clean()
Clean any state associated with the receiver and go to initial state
|
void |
init(Config cfg,
DataFlowOperation op,
java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> expectedIds)
Initialize the message receiver with tasks from which messages are expected
For each sub edge in graph, for each path, gives the expected task ids
|
protected abstract boolean |
isAllEmpty(int target) |
boolean |
isComplete()
Weather we are complete a set of messages
|
boolean |
progress()
This method will be called by the communicationProgress
|
protected boolean |
sync(int target) |
addMessage, clearTarget, isFilledToSend, merge, onMessage, onSyncEvent, sendToTargetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, onMessageprotected java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> syncReceived
protected <any> targetStates
protected <any> barriers
protected boolean stateCleared
public void init(Config cfg, DataFlowOperation op, java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> expectedIds)
MessageReceivertarget -> source tasks
init in interface MessageReceiverinit in class TargetReceiverexpectedIds - expected task idsprotected void addSyncMessage(int source,
int target)
TargetReceiveraddSyncMessage in class TargetReceiversource - sourcetarget - targetprotected void addSyncMessageBarrier(int source,
int target,
byte[] barrier)
TargetReceiveraddSyncMessageBarrier in class TargetReceiversource - sourcetarget - targetbarrier - the barrier messageprotected boolean canAcceptMessage(int source,
int target)
TargetReceivercanAcceptMessage in class TargetReceiversource - sourcetarget - targetpublic boolean progress()
MessageReceiverpublic boolean isComplete()
MessageReceiverprotected abstract boolean isAllEmpty(int target)
protected boolean sync(int target)
public void clean()
MessageReceiver