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>
TheUnsliceAssignerfor session windows.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SessionUnsliceAssigner(int rowtimeIndex, java.time.ZoneId shiftTimeZone, long sessionGap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<TimeWindow>assignActualWindow(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.Optional<TimeWindow>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.StringgetDescription()Returns a description of this window assigner.MergingWindowAssigner<TimeWindow>getMergingWindowAssigner()Currently, unslice assigner has an innerMergingWindowAssignerto reuse the logic inGroupWindowAssignerto merge windows.protected longgetUtcTimestamp(org.apache.flink.table.data.RowData element, ClockService clock)booleanisEventTime()Returnstrueif elements are assigned to windows based on event time,falsebased on processing time.
-
-
-
Method Detail
-
getMergingWindowAssigner
public MergingWindowAssigner<TimeWindow> 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 Exception
Description 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 Exception
Description 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
protected long getUtcTimestamp(org.apache.flink.table.data.RowData element, ClockService clock)
-
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
public String getDescription()
Description copied from interface:WindowAssignerReturns a description of this window assigner.- Specified by:
getDescriptionin interfaceWindowAssigner
-
-