Class MergingWindowProcessFunction<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.MergingWindowProcessFunction<K,W>
- Type Parameters:
W- The type ofWindowthat assigner assigns.
- All Implemented Interfaces:
Serializable
public class MergingWindowProcessFunction<K,W extends Window>
extends InternalWindowProcessFunction<K,W>
The implementation of
InternalWindowProcessFunction for MergingWindowAssigner.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA default merging consumer that merges the accumulators in state windows that waiting to be merged into the target state window.static interfaceNested 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 -
Constructor Summary
ConstructorsConstructorDescriptionMergingWindowProcessFunction(MergingWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer, 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 currentTime) Cleans the given window if needed.getStateWindow(W window) Get the state window as the namespace stored acc in the data about this actual window.voidInitialization method for the function.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
-
Constructor Details
-
MergingWindowProcessFunction
public MergingWindowProcessFunction(MergingWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer, long allowedLateness)
-
-
Method Details
-
open
Description copied from class:InternalWindowProcessFunctionInitialization method for the function. It is called before the actual working methods. -
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 cleanupcurrentTime- the current timestamp- Throws:
Exception
-
getStateWindow
Get the state window as the namespace stored acc in the data about this actual window.- Throws:
Exception
-