public static class UnsliceAssigners.SessionUnsliceAssigner extends Object implements UnsliceAssigner<TimeWindow>
UnsliceAssigner for session windows.| Constructor and Description |
|---|
SessionUnsliceAssigner(int rowtimeIndex,
ZoneId shiftTimeZone,
long sessionGap) |
| Modifier and Type | Method and Description |
|---|---|
Optional<TimeWindow> |
assignActualWindow(org.apache.flink.table.data.RowData element,
ClockService clock,
MergingWindowProcessFunction<?,TimeWindow> windowFunction)
Returns the
Window that the given element should belong to be used to trigger on. |
Optional<TimeWindow> |
assignStateNamespace(org.apache.flink.table.data.RowData element,
ClockService clock,
MergingWindowProcessFunction<?,TimeWindow> windowFunction)
Returns the
Window that the given element should belong to be used as a namespace to
restore the state. |
String |
getDescription()
Returns a description of this window assigner.
|
MergingWindowAssigner<TimeWindow> |
getMergingWindowAssigner()
Currently, unslice assigner has an inner
MergingWindowAssigner to reuse the logic in
GroupWindowAssigner to
merge windows. |
protected long |
getUtcTimestamp(org.apache.flink.table.data.RowData element,
ClockService clock) |
boolean |
isEventTime()
Returns
true if elements are assigned to windows based on event time, false
based on processing time. |
public SessionUnsliceAssigner(int rowtimeIndex,
ZoneId shiftTimeZone,
long sessionGap)
public MergingWindowAssigner<TimeWindow> getMergingWindowAssigner()
UnsliceAssignerMergingWindowAssigner to reuse the logic in
GroupWindowAssigner to
merge windows.getMergingWindowAssigner in interface UnsliceAssigner<TimeWindow>public Optional<TimeWindow> assignActualWindow(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?,TimeWindow> windowFunction) throws Exception
UnsliceAssignerWindow 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).
assignActualWindow in interface UnsliceAssigner<TimeWindow>element - the element to which slice should belong to.clock - the service to get current processing time.Exceptionpublic Optional<TimeWindow> assignStateNamespace(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?,TimeWindow> windowFunction) throws Exception
UnsliceAssignerWindow 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).
assignStateNamespace in interface UnsliceAssigner<TimeWindow>element - the element to which slice should belong to.clock - the service to get current processing time.Exceptionprotected long getUtcTimestamp(org.apache.flink.table.data.RowData element,
ClockService clock)
public boolean isEventTime()
WindowAssignertrue if elements are assigned to windows based on event time, false
based on processing time.isEventTime in interface WindowAssignerpublic String getDescription()
WindowAssignergetDescription in interface WindowAssignerCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.