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 class
AbstractWindowAggProcessor.WindowIsEmptySupplier
A 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 TypeSerializer<RowData>
accSerializer
protected NamespaceAggsHandleFunction<W>
aggregator
protected ClockService
clockService
protected WindowProcessor.Context<W>
ctx
protected long
currentProgress
protected AbstractWindowAggProcessor.WindowIsEmptySupplier
emptySupplier
protected GeneratedNamespaceAggsHandleFunction<W>
genAggsHandler
protected boolean
isEventTime
protected JoinedRowData
reuseOutput
protected ZoneId
shiftTimeZone
protected boolean
useDayLightSaving
The shift timezone is using DayLightSaving time or not.protected WindowValueState<W>
windowState
state schema: [key, window, accumulator].protected WindowTimerService<W>
windowTimerService
-
Constructor Summary
Constructors Constructor Description AbstractWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<W> genAggsHandler, WindowAssigner sliceAssigner, TypeSerializer<RowData> accSerializer, boolean isEventTime, int indexOfCountStar, ZoneId shiftTimeZone)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
The tear-down method of the function.protected void
collect(RowData aggResult)
Send result to downstream.protected abstract WindowTimerService<W>
getWindowTimerService()
void
initializeWatermark(long watermark)
Initializes the watermark which restores from state.void
open(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 TypeSerializer<RowData> accSerializer
-
isEventTime
protected final boolean isEventTime
-
shiftTimeZone
protected final 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 JoinedRowData reuseOutput
-
-
Constructor Detail
-
AbstractWindowAggProcessor
public AbstractWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<W> genAggsHandler, WindowAssigner sliceAssigner, TypeSerializer<RowData> accSerializer, boolean isEventTime, int indexOfCountStar, ZoneId shiftTimeZone)
-
-
Method Detail
-
open
public void open(WindowProcessor.Context<W> context) throws Exception
Description copied from interface:WindowProcessor
Initialization method for the function. It is called before the actual working methods.- Specified by:
open
in interfaceWindowProcessor<W>
- Throws:
Exception
-
getWindowTimerService
protected abstract WindowTimerService<W> getWindowTimerService()
-
initializeWatermark
public void initializeWatermark(long watermark)
Description copied from interface:WindowProcessor
Initializes the watermark which restores from state. The method is called after open method and before the actual working methods.- Specified by:
initializeWatermark
in interfaceWindowProcessor<W>
- Parameters:
watermark
- the initial watermark
-
close
public void close() throws Exception
Description copied from interface:WindowProcessor
The tear-down method of the function. It is called after the last call to the main working methods.- Specified by:
close
in interfaceWindowProcessor<W>
- Throws:
Exception
-
collect
protected void collect(RowData aggResult)
Send result to downstream.The
RowKind
of the results is alwaysRowKind.INSERT
.TODO support early fire / late file to produce changelog result.
-
-