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 WindowAssigner
. 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, latencyStats, LOG, metrics, output, processingTimeService
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.
|
close, getNumLateRecordsDropped, getWatermarkLatency, onEventTime, onProcessingTime, processElement
finish, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, registerCounterOnOutput, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
finish, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
processLatencyMarker, processWatermark, processWatermarkStatus
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.