Class GeneralWindowProcessFunction<K,W extends Window>
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.internal.InternalWindowProcessFunction<K,W>
-
- org.apache.flink.table.runtime.operators.window.internal.GeneralWindowProcessFunction<K,W>
-
- Type Parameters:
W- The type ofWindowthat assigner assigns.
- All Implemented Interfaces:
Serializable
public class GeneralWindowProcessFunction<K,W extends Window> extends InternalWindowProcessFunction<K,W>
The general implementation ofInternalWindowProcessFunction. TheWindowAssignershould be a regular assigner without implementPanedWindowAssignerorMergingWindowAssigner.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.window.internal.InternalWindowProcessFunction
InternalWindowProcessFunction.Context<K,W extends Window>
-
-
Field Summary
-
Fields inherited from class org.apache.flink.table.runtime.operators.window.internal.InternalWindowProcessFunction
allowedLateness, ctx, windowAggregator, windowAssigner
-
-
Constructor Summary
Constructors Constructor Description GeneralWindowProcessFunction(WindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<W>assignActualWindows(org.apache.flink.table.data.RowData inputRow, long timestamp)Assigns the input element into the actual windows which theTriggershould trigger on.Collection<W>assignStateNamespace(org.apache.flink.table.data.RowData inputRow, long timestamp)Assigns the input element into the state namespace which the input element should be accumulated/retracted into.voidcleanWindowIfNeeded(W window, long time)Cleans the given window if needed.voidprepareAggregateAccumulatorForEmit(W window)Prepares the accumulator of the given window before emit the final result.-
Methods inherited from class org.apache.flink.table.runtime.operators.window.internal.InternalWindowProcessFunction
close, isCleanupTime, isWindowLate, open
-
-
-
-
Constructor Detail
-
GeneralWindowProcessFunction
public GeneralWindowProcessFunction(WindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness)
-
-
Method Detail
-
assignStateNamespace
public Collection<W> assignStateNamespace(org.apache.flink.table.data.RowData inputRow, long timestamp) throws Exception
Description copied from class:InternalWindowProcessFunctionAssigns the input element into the state namespace which the input element should be accumulated/retracted into.- Specified by:
assignStateNamespacein classInternalWindowProcessFunction<K,W extends Window>- Parameters:
inputRow- the input elementtimestamp- the timestamp of the element or the processing time (depends on the type of assigner)- Returns:
- the state namespace
- Throws:
Exception
-
assignActualWindows
public Collection<W> assignActualWindows(org.apache.flink.table.data.RowData inputRow, long timestamp) throws Exception
Description copied from class:InternalWindowProcessFunctionAssigns the input element into the actual windows which theTriggershould trigger on.- Specified by:
assignActualWindowsin classInternalWindowProcessFunction<K,W extends Window>- Parameters:
inputRow- the input elementtimestamp- the timestamp of the element or the processing time (depends on the type of assigner)- Returns:
- the actual windows
- Throws:
Exception
-
prepareAggregateAccumulatorForEmit
public void prepareAggregateAccumulatorForEmit(W window) throws Exception
Description copied from class:InternalWindowProcessFunctionPrepares the accumulator of the given window before emit the final result. The accumulator is stored in the state or will be created if there is no corresponding accumulator in state.- Specified by:
prepareAggregateAccumulatorForEmitin classInternalWindowProcessFunction<K,W extends Window>- Parameters:
window- the window- Throws:
Exception
-
cleanWindowIfNeeded
public void cleanWindowIfNeeded(W window, long time) throws Exception
Description copied from class:InternalWindowProcessFunctionCleans the given window if needed.- Specified by:
cleanWindowIfNeededin classInternalWindowProcessFunction<K,W extends Window>- Parameters:
window- the window to cleanuptime- the current timestamp- Throws:
Exception
-
-