public abstract class KReduceStreamingReceiver extends KeyedReceiver
Modifier and Type | Field and Description |
---|---|
protected int |
localWindowCount
variable used to keep track of the current local window count.
|
protected ReduceFunction |
reduceFunction
The function that is used for the reduce operation
|
protected int |
windowSize
Streaming messages are only kept until the window size is met.
|
batchDone, dataFlowOperation, destination, executor, finishedSources, isEmptySent, isFinalBatchReceiver, keyLimit, limitPerKey, messages, representSource, representSourceSet, sendQueue, thisSources
Constructor and Description |
---|
KReduceStreamingReceiver() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
moveMessagesToSendQueue(int target,
java.util.Map<java.lang.Object,java.util.Queue<java.lang.Object>> messagesPerTarget)
moves all the buffered messages into the sendQueue for the given target, this method assumes
that for each target that there is only one object in the queue.
|
protected boolean |
offerMessage(int target,
java.lang.Object object)
The reduce operation overrides the offer method because the reduce operation
does not save all the incoming messages, it rather reduces messages with the same key and
saves only the reduced values.
|
checkIfEmptyIsSent, finishProgress, init, isAllQueuesEmpty, isComplete, isSourcesFinished, moveMessageToSendQueue, onFinish, onMessage, progress, sendToTarget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clean, close, onMessage
protected ReduceFunction reduceFunction
protected int windowSize
protected int localWindowCount
protected boolean offerMessage(int target, java.lang.Object object)
offerMessage
in class KeyedReceiver
target
- target for which the messages are to be addedobject
- the message/messages to be addedprotected boolean moveMessagesToSendQueue(int target, java.util.Map<java.lang.Object,java.util.Queue<java.lang.Object>> messagesPerTarget)
moveMessagesToSendQueue
in class KeyedReceiver
target
- target for which the move needs to be donemessagesPerTarget
- messages for given target