Class UnsliceSyncStateWindowAggProcessor
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.aggregate.window.processors.WindowAggProcessorBase<W,SyncStateWindowProcessor.SyncStateContext<W>>
-
- org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractSyncStateWindowAggProcessor<TimeWindow>
-
- org.apache.flink.table.runtime.operators.aggregate.window.processors.UnsliceSyncStateWindowAggProcessor
-
- All Implemented Interfaces:
Serializable,SyncStateWindowProcessor<TimeWindow>,WindowProcessor<TimeWindow,SyncStateWindowProcessor.SyncStateContext<TimeWindow>>,UnslicingSyncStateWindowProcessor<TimeWindow>
public class UnsliceSyncStateWindowAggProcessor extends AbstractSyncStateWindowAggProcessor<TimeWindow> implements UnslicingSyncStateWindowProcessor<TimeWindow>
An window aggregate processor implementation which works forUnsliceAssigner, e.g. session windows.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractSyncStateWindowAggProcessor
AbstractSyncStateWindowAggProcessor.WindowIsEmptySupplier
-
Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.SyncStateWindowProcessor
SyncStateWindowProcessor.SyncStateContext<W>
-
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 MergingWindowProcessFunction<org.apache.flink.table.data.RowData,TimeWindow>windowFunction-
Fields inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractSyncStateWindowAggProcessor
emptySupplier, windowState
-
Fields inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.WindowAggProcessorBase
accSerializer, aggregator, clockService, ctx, currentProgress, genAggsHandler, isEventTime, reuseOutput, shiftTimeZone, useDayLightSaving, windowTimerService
-
-
Constructor Summary
Constructors Constructor Description UnsliceSyncStateWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<TimeWindow> genAggsHandler, UnsliceAssigner<TimeWindow> unsliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, int indexOfCountStar, ZoneId shiftTimeZone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceProgress(long progress)Advances the progress time, the progress time is watermark if working in event-time mode, or current processing time if working in processing-time mode.voidclearWindow(long timerTimestamp, TimeWindow window)Clear state and resources associated with the given window namespace.org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow>createWindowSerializer()Returns the serializer of the window type.voidfireWindow(long timerTimestamp, TimeWindow window)Emit results of the given window.protected WindowTimerService<TimeWindow>getWindowTimerService()voidopen(SyncStateWindowProcessor.SyncStateContext<TimeWindow> context)Initialization method for the function.voidprepareCheckpoint()Performs a preparation before checkpoint.booleanprocessElement(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element)Process an element with associated key from the input stream.-
Methods inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractSyncStateWindowAggProcessor
collect, prepareAggregator
-
Methods inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.WindowAggProcessorBase
close, collect, initializeWatermark
-
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
close, initializeWatermark
-
-
-
-
Field Detail
-
windowFunction
protected transient MergingWindowProcessFunction<org.apache.flink.table.data.RowData,TimeWindow> windowFunction
-
-
Constructor Detail
-
UnsliceSyncStateWindowAggProcessor
public UnsliceSyncStateWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<TimeWindow> genAggsHandler, UnsliceAssigner<TimeWindow> unsliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, int indexOfCountStar, ZoneId shiftTimeZone)
-
-
Method Detail
-
open
public void open(SyncStateWindowProcessor.SyncStateContext<TimeWindow> context) throws Exception
Description copied from interface:WindowProcessorInitialization method for the function. It is called before the actual working methods.- Specified by:
openin interfaceWindowProcessor<TimeWindow,SyncStateWindowProcessor.SyncStateContext<TimeWindow>>- Overrides:
openin classAbstractSyncStateWindowAggProcessor<TimeWindow>- Throws:
Exception
-
processElement
public boolean processElement(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element) throws ExceptionDescription copied from interface:SyncStateWindowProcessorProcess an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.- Specified by:
processElementin interfaceSyncStateWindowProcessor<TimeWindow>- Parameters:
key- the key associated with the elementelement- The element to process.- Throws:
Exception
-
fireWindow
public void fireWindow(long timerTimestamp, TimeWindow window) throws ExceptionDescription copied from interface:SyncStateWindowProcessorEmit results of the given window.Note: the key context has been set.
- Specified by:
fireWindowin interfaceSyncStateWindowProcessor<TimeWindow>- Parameters:
timerTimestamp- the fired timestampwindow- the window to emit- Throws:
Exception
-
clearWindow
public void clearWindow(long timerTimestamp, TimeWindow window) throws ExceptionDescription copied from interface:SyncStateWindowProcessorClear state and resources associated with the given window namespace.Note: the key context has been set.
- Specified by:
clearWindowin interfaceSyncStateWindowProcessor<TimeWindow>- Parameters:
timerTimestamp- the fired timestampwindow- the window to clear- Throws:
Exception
-
advanceProgress
public void advanceProgress(long progress) throws ExceptionDescription copied from interface:SyncStateWindowProcessorAdvances the progress time, the progress time is watermark if working in event-time mode, or current processing time if working in processing-time mode.This will potentially flush buffered data into states, because the watermark advancement may be in a very small step, but we don't need to flush buffered data for every watermark advancement.
- Specified by:
advanceProgressin interfaceSyncStateWindowProcessor<TimeWindow>- Parameters:
progress- the current progress time- Throws:
Exception
-
prepareCheckpoint
public void prepareCheckpoint() throws ExceptionDescription copied from interface:SyncStateWindowProcessorPerforms a preparation before checkpoint. This usually flushes buffered data into state.- Specified by:
prepareCheckpointin interfaceSyncStateWindowProcessor<TimeWindow>- Throws:
Exception
-
createWindowSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow> createWindowSerializer()
Description copied from interface:WindowProcessorReturns the serializer of the window type.- Specified by:
createWindowSerializerin interfaceWindowProcessor<TimeWindow,SyncStateWindowProcessor.SyncStateContext<TimeWindow>>
-
getWindowTimerService
protected WindowTimerService<TimeWindow> getWindowTimerService()
- Specified by:
getWindowTimerServicein classWindowAggProcessorBase<TimeWindow,SyncStateWindowProcessor.SyncStateContext<TimeWindow>>
-
-