public class TargetPartialReceiver extends TargetReceiver
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Integer,byte[]> |
barriers
The barriers for each source
|
protected <any> |
sourceStates
Keep state
|
protected boolean |
stateCleared
State is cleared
|
protected <any> |
syncSent
Keep track what are the targets we've sent syncs to
|
destination, groupingSize, highWaterMark, lock, messages, operation, representSource, syncState, targets, thisDestinations, thisSources, workerId| Constructor and Description |
|---|
TargetPartialReceiver() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMessage(int target,
java.util.List<java.lang.Object> msgQueue,
java.lang.Object value) |
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
|
boolean |
isComplete()
Weather we are complete a set of messages
|
protected boolean |
isFilledToSend(int target)
Return true if we are filled to send
|
protected void |
merge(int dest,
java.util.List<java.lang.Object> dests)
Swap the messages to the ready queue
|
protected boolean |
onSyncEvent(int target,
byte[] value)
This method is called when there is a sync event on the operation
|
boolean |
progress()
This method will be called by the communicationProgress
|
protected boolean |
sendToTarget(int source,
int target)
This gets called with a represented source
|
boolean |
sync()
Handle the sync
|
clearTarget, onMessageclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, onMessageprotected <any> sourceStates
protected <any> syncSent
protected java.util.Map<java.lang.Integer,byte[]> 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 merge(int dest,
java.util.List<java.lang.Object> dests)
merge in class TargetReceiverdest - the targetdests - message queue to switch to readyprotected boolean sendToTarget(int source,
int target)
sendToTarget in class TargetReceiversource - the sources the represented sourcetarget - the target the true targetprotected boolean isFilledToSend(int target)
TargetReceiverisFilledToSend in class TargetReceiverprotected 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 void addMessage(int target,
java.util.List<java.lang.Object> msgQueue,
java.lang.Object value)
addMessage in class TargetReceiverprotected boolean canAcceptMessage(int source,
int target)
TargetReceivercanAcceptMessage in class TargetReceiversource - sourcetarget - targetpublic boolean progress()
MessageReceiverpublic boolean isComplete()
MessageReceiverpublic boolean sync()
public void clean()
MessageReceiverprotected boolean onSyncEvent(int target,
byte[] value)
TargetReceiveronSyncEvent in class TargetReceivertarget - the target to which the sync event belongvalue - the byte value, can be null