Class InternalWindowProcessFunction<K,W extends Window>
java.lang.Object
org.apache.flink.table.runtime.operators.window.groupwindow.internal.InternalWindowProcessFunction<K,W>
- Type Parameters:
W- type of window
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GeneralWindowProcessFunction,MergingWindowProcessFunction,PanedWindowProcessFunction
public abstract class InternalWindowProcessFunction<K,W extends Window>
extends Object
implements Serializable
The internal interface for functions that process over grouped windows.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInternalWindowProcessFunction.Context<K,W extends Window> Information available in an invocation of methods ofInternalWindowProcessFunction. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longprotected InternalWindowProcessFunction.Context<K,W> protected final NamespaceAggsHandleFunctionBase<W>protected final GroupWindowAssigner<W> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInternalWindowProcessFunction(GroupWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness) -
Method Summary
Modifier and TypeMethodDescriptionabstract Collection<W>assignActualWindows(org.apache.flink.table.data.RowData inputRow, long timestamp) Assigns the input element into the actual windows which theTriggershould trigger on.abstract 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.abstract voidcleanWindowIfNeeded(W window, long currentTime) Cleans the given window if needed.voidclose()The tear-down method of the function.protected final booleanisCleanupTime(W window, long time) Returnstrueif the given time is the cleanup time for the given window.protected booleanisWindowLate(W window) Returnstrueif the watermark is after the end timestamp plus the allowed lateness of the given window.voidInitialization method for the function.abstract voidprepareAggregateAccumulatorForEmit(W window) Prepares the accumulator of the given window before emit the final result.
-
Field Details
-
windowAssigner
-
windowAggregator
-
allowedLateness
protected final long allowedLateness -
ctx
-
-
Constructor Details
-
InternalWindowProcessFunction
protected InternalWindowProcessFunction(GroupWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness)
-
-
Method Details
-
open
Initialization method for the function. It is called before the actual working methods.- Throws:
Exception
-
assignStateNamespace
public abstract Collection<W> assignStateNamespace(org.apache.flink.table.data.RowData inputRow, long timestamp) throws Exception Assigns the input element into the state namespace which the input element should be accumulated/retracted into.- 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 abstract Collection<W> assignActualWindows(org.apache.flink.table.data.RowData inputRow, long timestamp) throws Exception Assigns the input element into the actual windows which theTriggershould trigger on.- 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
Prepares 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.- Parameters:
window- the window- Throws:
Exception
-
cleanWindowIfNeeded
Cleans the given window if needed.- Parameters:
window- the window to cleanupcurrentTime- the current timestamp- Throws:
Exception
-
close
The tear-down method of the function. It is called after the last call to the main working methods.- Throws:
Exception
-
isCleanupTime
Returnstrueif the given time is the cleanup time for the given window. -
isWindowLate
Returnstrueif the watermark is after the end timestamp plus the allowed lateness of the given window.
-