Class MergingWindowProcessFunction<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.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 ofInternalWindowProcessFunctionforMergingWindowAssigner.- 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
-
-
Constructor Summary
Constructors Constructor Description MergingWindowProcessFunction(MergingWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer, 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 currentTime)Cleans the given window if needed.voidopen(InternalWindowProcessFunction.Context<K,W> ctx)Initialization 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.internal.InternalWindowProcessFunction
close, isCleanupTime, isWindowLate
-
-
-
-
Constructor Detail
-
MergingWindowProcessFunction
public MergingWindowProcessFunction(MergingWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer, long allowedLateness)
-
-
Method Detail
-
open
public void open(InternalWindowProcessFunction.Context<K,W> ctx) throws Exception
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
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 currentTime) 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 cleanupcurrentTime- the current timestamp- Throws:
Exception
-
-