Class UnsliceAssigners.SessionUnsliceAssigner
java.lang.Object
org.apache.flink.table.runtime.operators.window.tvf.unslicing.UnsliceAssigners.SessionUnsliceAssigner
- All Implemented Interfaces:
Serializable,WindowAssigner,UnsliceAssigner<TimeWindow>
- Enclosing class:
- UnsliceAssigners
public static class UnsliceAssigners.SessionUnsliceAssigner
extends Object
implements UnsliceAssigner<TimeWindow>
The
UnsliceAssigner for session windows.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSessionUnsliceAssigner(int rowtimeIndex, ZoneId shiftTimeZone, long sessionGap) -
Method Summary
Modifier and TypeMethodDescriptionassignActualWindow(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?, TimeWindow> windowFunction) Returns theWindowthat the given element should belong to be used to trigger on.assignStateNamespace(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?, TimeWindow> windowFunction) Returns theWindowthat the given element should belong to be used as a namespace to restore the state.Returns a description of this window assigner.Currently, unslice assigner has an innerMergingWindowAssignerto reuse the logic inGroupWindowAssignerto merge windows.protected longgetUtcTimestamp(org.apache.flink.table.data.RowData element, ClockService clock) booleanReturnstrueif elements are assigned to windows based on event time,falsebased on processing time.
-
Constructor Details
-
SessionUnsliceAssigner
-
-
Method Details
-
getMergingWindowAssigner
Description copied from interface:UnsliceAssignerCurrently, unslice assigner has an innerMergingWindowAssignerto reuse the logic inGroupWindowAssignerto merge windows.- Specified by:
getMergingWindowAssignerin interfaceUnsliceAssigner<TimeWindow>
-
assignActualWindow
public Optional<TimeWindow> assignActualWindow(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?, TimeWindow> windowFunction) throws ExceptionDescription copied from interface:UnsliceAssignerReturns 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).- Specified by:
assignActualWindowin interfaceUnsliceAssigner<TimeWindow>- 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
public Optional<TimeWindow> assignStateNamespace(org.apache.flink.table.data.RowData element, ClockService clock, MergingWindowProcessFunction<?, TimeWindow> windowFunction) throws ExceptionDescription copied from interface:UnsliceAssignerReturns 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).- Specified by:
assignStateNamespacein interfaceUnsliceAssigner<TimeWindow>- 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
-
getUtcTimestamp
-
isEventTime
public boolean isEventTime()Description copied from interface:WindowAssignerReturnstrueif elements are assigned to windows based on event time,falsebased on processing time.- Specified by:
isEventTimein interfaceWindowAssigner
-
getDescription
Description copied from interface:WindowAssignerReturns a description of this window assigner.- Specified by:
getDescriptionin interfaceWindowAssigner
-