Class GeneralWindowProcessFunction<K,W extends Window>
java.lang.Object
org.apache.flink.table.runtime.operators.window.groupwindow.internal.InternalWindowProcessFunction<K,W>
org.apache.flink.table.runtime.operators.window.groupwindow.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 of
InternalWindowProcessFunction. The GroupWindowAssigner should be a regular assigner without implement PanedWindowAssigner
or MergingWindowAssigner.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.internal.InternalWindowProcessFunction
InternalWindowProcessFunction.Context<K,W extends Window> -
Field Summary
Fields inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.internal.InternalWindowProcessFunction
allowedLateness, ctx, windowAggregator, windowAssigner -
Constructor Summary
ConstructorsConstructorDescriptionGeneralWindowProcessFunction(GroupWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness) -
Method Summary
Modifier and TypeMethodDescriptionassignActualWindows(org.apache.flink.table.data.RowData inputRow, long timestamp) Assigns the input element into the actual windows which theTriggershould trigger on.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.groupwindow.internal.InternalWindowProcessFunction
close, isCleanupTime, isWindowLate, open
-
Constructor Details
-
GeneralWindowProcessFunction
public GeneralWindowProcessFunction(GroupWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness)
-
-
Method Details
-
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
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
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
-