Interface UnsliceAssigner<W extends Window>
-
- All Superinterfaces:
Serializable,WindowAssigner
- All Known Implementing Classes:
UnsliceAssigners.SessionUnsliceAssigner,UnsliceAssigners.WindowedUnsliceAssigner
@Internal public interface UnsliceAssigner<W extends Window> extends WindowAssigner
AUnsliceAssignerassigns each element into a single window and not divides the window into finite number of non-overlapping slice. Different withSliceAssigner, we use theWindowto identifier a window.UnsliceAssigneris designed for unaligned Windows like session window.Because unaligned Windows are windows determined dynamically based on elements, and its window boundaries are determined based on the messages timestamps and their correlations, some windows may be merged into one.
- See Also:
for more definition of unslice window.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<W>assignActualWindow(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?,W> windowFunction)Returns theWindowthat the given element should belong to be used to trigger on.Optional<W>assignStateNamespace(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?,W> windowFunction)Returns theWindowthat the given element should belong to be used as a namespace to restore the state.MergingWindowAssigner<W>getMergingWindowAssigner()Currently, unslice assigner has an innerMergingWindowAssignerto reuse the logic inGroupWindowAssignerto merge windows.-
Methods inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowAssigner
getDescription, isEventTime
-
-
-
-
Method Detail
-
assignActualWindow
Optional<W> assignActualWindow(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?,W> windowFunction) throws Exception
Returns theWindowthat the given element should belong to be used to trigger on.See more details in
MergingWindowProcessFunction.assignActualWindows(org.apache.flink.table.data.RowData, long).- Parameters:
element- the element to which slice should belong to.clock- the service to get current processing time.- Returns:
- if empty, that means the element is late.
- Throws:
Exception
-
assignStateNamespace
Optional<W> assignStateNamespace(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?,W> windowFunction) throws Exception
Returns theWindowthat the given element should belong to be used as a namespace to restore the state.See more details in
MergingWindowProcessFunction.assignStateNamespace(org.apache.flink.table.data.RowData, long).- Parameters:
element- the element to which slice should belong to.clock- the service to get current processing time.- Returns:
- if empty, that means the element is late.
- Throws:
Exception
-
getMergingWindowAssigner
MergingWindowAssigner<W> getMergingWindowAssigner()
Currently, unslice assigner has an innerMergingWindowAssignerto reuse the logic inGroupWindowAssignerto merge windows.
-
-