public abstract class ReduceBatchReceiver extends SourceReceiver
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Integer,java.lang.Object> |
reducedValueMap |
protected ReduceFunction |
reduceFunction |
barriers, destination, isSyncSent, messages, operation, sendPendingMax, sourcesOfTarget, syncReceived, syncState, targetStates, workerId| Constructor and Description |
|---|
ReduceBatchReceiver(int dst,
ReduceFunction reduce) |
ReduceBatchReceiver(ReduceFunction reduceFunction) |
| 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
|
abstract boolean |
handleMessage(int source,
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 boolean |
isFilledToSend(int target,
boolean sync)
Return true if we are filled to send
|
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, onFinish, onMessage, progress, sendSyncForwardclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, onMessageprotected ReduceFunction reduceFunction
protected java.util.Map<java.lang.Integer,java.lang.Object> reducedValueMap
public ReduceBatchReceiver(ReduceFunction reduceFunction)
public ReduceBatchReceiver(int dst,
ReduceFunction reduce)
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 SourceReceiverexpectedIds - expected task idspublic abstract boolean handleMessage(int source,
java.lang.Object message,
int flags,
int dest)
protected boolean sendToTarget(int target,
boolean sync)
SourceReceiversendToTarget in class SourceReceivertarget - the targetprotected boolean aggregate(int target,
boolean sync,
boolean allValuesFound)
SourceReceiveraggregate in class SourceReceivertarget - targetsync - true if all the syncs are presentprotected boolean isAllEmpty(int target)
SourceReceiverisAllEmpty in class SourceReceivertarget - targetprotected boolean isFilledToSend(int target,
boolean sync)
SourceReceiverisFilledToSend in class SourceReceiverprotected void onSyncEvent(int target,
byte[] value)
SourceReceiveronSyncEvent in class SourceReceivertarget - the target to which the sync event belongvalue - the byte value, can be null