@Internal public interface UnsliceAssigner<W extends Window> extends WindowAssigner
UnsliceAssigner
assigns each element into a single window and not divides the window
into finite number of non-overlapping slice. Different with SliceAssigner
, we use the
Window
to identifier a window.
UnsliceAssigner
is 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.
for more definition of unslice window.
Modifier and Type | Method and Description |
---|---|
Optional<W> |
assignActualWindow(RowData element,
ClockService clock,
MergingWindowProcessFunction<?,W> windowFunction)
Returns the
Window that the given element should belong to be used to trigger on. |
Optional<W> |
assignStateNamespace(RowData element,
ClockService clock,
MergingWindowProcessFunction<?,W> windowFunction)
Returns the
Window that the given element should belong to be used as a namespace to
restore the state. |
MergingWindowAssigner<W> |
getMergingWindowAssigner()
Currently, unslice assigner has an inner
MergingWindowAssigner to reuse the logic in
GroupWindowAssigner to
merge windows. |
getDescription, isEventTime
Optional<W> assignActualWindow(RowData element, ClockService clock, MergingWindowProcessFunction<?,W> windowFunction) throws Exception
Window
that the given element should belong to be used to trigger on.
See more details in MergingWindowProcessFunction.assignActualWindows(org.apache.flink.table.data.RowData, long)
.
element
- the element to which slice should belong to.clock
- the service to get current processing time.Exception
Optional<W> assignStateNamespace(RowData element, ClockService clock, MergingWindowProcessFunction<?,W> windowFunction) throws Exception
Window
that 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)
.
element
- the element to which slice should belong to.clock
- the service to get current processing time.Exception
MergingWindowAssigner<W> getMergingWindowAssigner()
MergingWindowAssigner
to reuse the logic in
GroupWindowAssigner
to
merge windows.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.