public abstract class BaseGatherBatchReceiver extends SourceReceiver
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Object>> |
gatheredValuesMap |
protected static java.util.logging.Logger |
LOG |
barriers, destination, isSyncSent, messages, operation, sendPendingMax, sourcesOfTarget, syncReceived, syncState, targetStates, workerId
Constructor and Description |
---|
BaseGatherBatchReceiver() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
aggregate(int target,
boolean sync,
boolean allValuesFound)
Aggregate values from sources for a target, assumes every source has a value
|
protected abstract boolean |
handleMessage(int task,
java.lang.Object message,
int flags,
int dest) |
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)
Check weather all the other information is flushed
|
protected void |
onSyncEvent(int target,
byte[] value)
This method is called when there is a sync event on the operation
|
protected boolean |
sendToTarget(int target,
boolean sync)
Send the values to a target
|
allQueuesEmpty, allSyncsPresent, clean, isComplete, isFilledToSend, onFinish, onMessage, progress, sendSyncForward
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, onMessage
protected static final java.util.logging.Logger LOG
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Object>> gatheredValuesMap
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 SourceReceiver
expectedIds
- expected task idsprotected boolean sendToTarget(int target, boolean sync)
SourceReceiver
sendToTarget
in class SourceReceiver
target
- the targetprotected boolean aggregate(int target, boolean sync, boolean allValuesFound)
SourceReceiver
aggregate
in class SourceReceiver
target
- targetsync
- true if all the syncs are presentprotected boolean isAllEmpty(int target)
SourceReceiver
isAllEmpty
in class SourceReceiver
target
- targetprotected abstract boolean handleMessage(int task, java.lang.Object message, int flags, int dest)
protected void onSyncEvent(int target, byte[] value)
SourceReceiver
onSyncEvent
in class SourceReceiver
target
- the target to which the sync event belongvalue
- the byte value, can be null