Class AbstractWindowAggProcessor<W>
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractWindowAggProcessor<W>
-
- All Implemented Interfaces:
Serializable,WindowProcessor<W>
- Direct Known Subclasses:
AbstractSliceWindowAggProcessor,UnsliceWindowAggProcessor
public abstract class AbstractWindowAggProcessor<W> extends Object implements WindowProcessor<W>
A base class for window aggregate processors.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractWindowAggProcessor.WindowIsEmptySupplierA supplier that returns whether the window is empty.-
Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowProcessor
WindowProcessor.Context<W>
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData>accSerializerprotected NamespaceAggsHandleFunction<W>aggregatorprotected ClockServiceclockServiceprotected WindowProcessor.Context<W>ctxprotected longcurrentProgressprotected AbstractWindowAggProcessor.WindowIsEmptySupplieremptySupplierprotected GeneratedNamespaceAggsHandleFunction<W>genAggsHandlerprotected booleanisEventTimeprotected org.apache.flink.table.data.utils.JoinedRowDatareuseOutputprotected java.time.ZoneIdshiftTimeZoneprotected booleanuseDayLightSavingThe shift timezone is using DayLightSaving time or not.protected WindowValueState<W>windowStatestate schema: [key, window, accumulator].protected WindowTimerService<W>windowTimerService
-
Constructor Summary
Constructors Constructor Description AbstractWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<W> genAggsHandler, WindowAssigner sliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, boolean isEventTime, int indexOfCountStar, java.time.ZoneId shiftTimeZone)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()The tear-down method of the function.protected voidcollect(org.apache.flink.table.data.RowData aggResult)Send result to downstream.protected abstract WindowTimerService<W>getWindowTimerService()voidinitializeWatermark(long watermark)Initializes the watermark which restores from state.voidopen(WindowProcessor.Context<W> context)Initialization method for the function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowProcessor
advanceProgress, clearWindow, createWindowSerializer, fireWindow, prepareCheckpoint, processElement
-
-
-
-
Field Detail
-
genAggsHandler
protected final GeneratedNamespaceAggsHandleFunction<W> genAggsHandler
-
accSerializer
protected final org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer
-
isEventTime
protected final boolean isEventTime
-
shiftTimeZone
protected final java.time.ZoneId shiftTimeZone
-
useDayLightSaving
protected final boolean useDayLightSaving
The shift timezone is using DayLightSaving time or not.
-
emptySupplier
protected final AbstractWindowAggProcessor.WindowIsEmptySupplier emptySupplier
-
currentProgress
protected transient long currentProgress
-
ctx
protected transient WindowProcessor.Context<W> ctx
-
clockService
protected transient ClockService clockService
-
windowTimerService
protected transient WindowTimerService<W> windowTimerService
-
aggregator
protected transient NamespaceAggsHandleFunction<W> aggregator
-
windowState
protected transient WindowValueState<W> windowState
state schema: [key, window, accumulator].
-
reuseOutput
protected transient org.apache.flink.table.data.utils.JoinedRowData reuseOutput
-
-
Constructor Detail
-
AbstractWindowAggProcessor
public AbstractWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<W> genAggsHandler, WindowAssigner sliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, boolean isEventTime, int indexOfCountStar, java.time.ZoneId shiftTimeZone)
-
-
Method Detail
-
open
public void open(WindowProcessor.Context<W> context) throws Exception
Description copied from interface:WindowProcessorInitialization method for the function. It is called before the actual working methods.- Specified by:
openin interfaceWindowProcessor<W>- Throws:
Exception
-
getWindowTimerService
protected abstract WindowTimerService<W> getWindowTimerService()
-
initializeWatermark
public void initializeWatermark(long watermark)
Description copied from interface:WindowProcessorInitializes the watermark which restores from state. The method is called after open method and before the actual working methods.- Specified by:
initializeWatermarkin interfaceWindowProcessor<W>- Parameters:
watermark- the initial watermark
-
close
public void close() throws ExceptionDescription copied from interface:WindowProcessorThe tear-down method of the function. It is called after the last call to the main working methods.- Specified by:
closein interfaceWindowProcessor<W>- Throws:
Exception
-
collect
protected void collect(org.apache.flink.table.data.RowData aggResult)
Send result to downstream.The
RowKindof the results is alwaysRowKind.INSERT.TODO support early fire / late file to produce changelog result.
-
-