public class BcastGatherBatchReceiver extends TargetFinalReceiver
barriers, stateCleared, syncReceived, targetStates
destination, groupingSize, highWaterMark, lock, messages, operation, representSource, syncState, targets, thisDestinations, thisSources, workerId
Constructor and Description |
---|
BcastGatherBatchReceiver(BulkReceiver receiver) |
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
|
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 boolean |
isAllEmpty(int target) |
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
|
protected boolean |
sendToTarget(int source,
int target)
Send the values to a target
|
canAcceptMessage, clean, isComplete, progress, sync
addMessage, clearTarget, onMessage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, onMessage
public BcastGatherBatchReceiver(BulkReceiver receiver)
public void init(Config cfg, DataFlowOperation op, java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> expectedIds)
MessageReceiver
target -> source tasks
init
in interface MessageReceiver
init
in class TargetFinalReceiver
expectedIds
- expected task idsprotected void addSyncMessage(int source, int target)
TargetReceiver
addSyncMessage
in class TargetFinalReceiver
source
- sourcetarget
- targetprotected void addSyncMessageBarrier(int source, int target, byte[] barrier)
TargetReceiver
addSyncMessageBarrier
in class TargetFinalReceiver
source
- sourcetarget
- targetbarrier
- the barrier messageprotected void merge(int dest, java.util.List<java.lang.Object> dests)
TargetReceiver
merge
in class TargetReceiver
dest
- the targetdests
- message queue to switch to readyprotected boolean isAllEmpty(int target)
isAllEmpty
in class TargetFinalReceiver
protected boolean sendToTarget(int source, int target)
TargetReceiver
sendToTarget
in class TargetReceiver
source
- the sourcestarget
- the targetprotected boolean isFilledToSend(int target)
TargetReceiver
isFilledToSend
in class TargetReceiver
protected boolean onSyncEvent(int target, byte[] value)
TargetReceiver
onSyncEvent
in class TargetReceiver
target
- the target to which the sync event belongvalue
- the byte value, can be null