K
- The type of key returned by the KeySelector
.W
- The type of Window
that the WindowAssigner
assigns.public class AggregateWindowOperator<K,W extends Window> extends WindowOperator<K,W>
WindowOperator
for grouped window aggregates.
When an element arrives it gets assigned a key using a KeySelector
and it gets
assigned to zero or more windows using a GroupWindowAssigner
. Based on this, the element
is put into panes. A pane is the bucket of elements that have the same key and same Window
. An element can be in multiple panes if it was assigned to multiple windows by the WindowAssigner
.
Each pane gets its own instance of the provided Trigger
. This trigger determines when
the contents of the pane should be processed to emit results. When a trigger fires, the given
NamespaceAggsHandleFunction.getValue(Object)
is invoked to produce the results that are
emitted for the pane to which the Trigger
belongs.
Modifier and Type | Field and Description |
---|---|
protected RecordEqualiser |
equaliser
The util to compare two RowData equals to each other.
|
collector, previousState, produceUpdates, recordCounter, shiftTimeZone, windowAggregator, windowFunction
chainingStrategy, config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager
Modifier and Type | Method and Description |
---|---|
protected void |
compileGeneratedCode() |
protected void |
emitWindowResult(W window)
Emits the window result of the given window.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g. state initialization.
|
close, getNumLateRecordsDropped, getWatermarkLatency, onEventTime, onProcessingTime, processElement
finish, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, snapshotState, useSplittableTimers
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
processLatencyMarker, processRecordAttributes, processWatermark, processWatermarkStatus
hasKeyContext
protected RecordEqualiser equaliser
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<RowData>
open
in class WindowOperator<K,W extends Window>
Exception
- An exception in this method causes the operator to fail.protected void compileGeneratedCode()
compileGeneratedCode
in class WindowOperator<K,W extends Window>
protected void emitWindowResult(W window) throws Exception
WindowOperator
emitWindowResult
in class WindowOperator<K,W extends Window>
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.