Class UnsliceAssigners.WindowedUnsliceAssigner
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.groupwindow.assigners.GroupWindowAssigner<W>
-
- org.apache.flink.table.runtime.operators.window.groupwindow.assigners.MergingWindowAssigner<TimeWindow>
-
- org.apache.flink.table.runtime.operators.window.tvf.unslicing.UnsliceAssigners.WindowedUnsliceAssigner
-
- All Implemented Interfaces:
Serializable,InternalTimeWindowAssigner,WindowAssigner,UnsliceAssigner<TimeWindow>
- Enclosing class:
- UnsliceAssigners
public static class UnsliceAssigners.WindowedUnsliceAssigner extends MergingWindowAssigner<TimeWindow> implements UnsliceAssigner<TimeWindow>, InternalTimeWindowAssigner
TheUnsliceAssignerfor elements have been merged into unslicing windows and attached window start and end timestamps.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WindowedUnsliceAssigner(int windowStartIndex, int windowEndIndex, UnsliceAssigner<TimeWindow> innerAssigner)
-
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.Collection<TimeWindow>assignWindows(org.apache.flink.table.data.RowData element, long timestamp)Given the timestamp and element, returns the set of windows into which it should be placed.StringgetDescription()Returns a description of this window assigner.MergingWindowAssigner<TimeWindow>getMergingWindowAssigner()Currently, unslice assigner has an innerMergingWindowAssignerto reuse the logic inGroupWindowAssignerto merge windows.org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow>getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)Returns aTypeSerializerfor serializing windows that are assigned by thisWindowAssigner.booleanisEventTime()Returnstrueif elements are assigned to windows based on event time,falseotherwise.voidmergeWindows(TimeWindow newWindow, NavigableSet<TimeWindow> sortedWindows, MergeCallback<TimeWindow,Collection<TimeWindow>> callback)Determines which windows (if any) should be merged.StringtoString()InternalTimeWindowAssignerwithEventTime()InternalTimeWindowAssignerwithProcessingTime()-
Methods inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.assigners.GroupWindowAssigner
open
-
-
-
-
Constructor Detail
-
WindowedUnsliceAssigner
public WindowedUnsliceAssigner(int windowStartIndex, int windowEndIndex, UnsliceAssigner<TimeWindow> innerAssigner)
-
-
Method Detail
-
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
-
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>
-
isEventTime
public boolean isEventTime()
Description copied from class:GroupWindowAssignerReturnstrueif elements are assigned to windows based on event time,falseotherwise.- Specified by:
isEventTimein interfaceWindowAssigner- Specified by:
isEventTimein classGroupWindowAssigner<TimeWindow>
-
assignWindows
public Collection<TimeWindow> assignWindows(org.apache.flink.table.data.RowData element, long timestamp) throws IOException
Description copied from class:GroupWindowAssignerGiven the timestamp and element, returns the set of windows into which it should be placed.- Specified by:
assignWindowsin classGroupWindowAssigner<TimeWindow>- Parameters:
element- The element to which windows should be assigned.timestamp- The timestamp of the element whenGroupWindowAssigner.isEventTime()returns true, or the current system time whenGroupWindowAssigner.isEventTime()returns false. The timestamp value is mapping to UTC milliseconds for splitting windows simply.- Throws:
IOException
-
getWindowSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow> getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
Description copied from class:GroupWindowAssignerReturns aTypeSerializerfor serializing windows that are assigned by thisWindowAssigner.- Specified by:
getWindowSerializerin classGroupWindowAssigner<TimeWindow>
-
toString
public String toString()
- Specified by:
toStringin classGroupWindowAssigner<TimeWindow>
-
getDescription
public String getDescription()
Description copied from interface:WindowAssignerReturns a description of this window assigner.- Specified by:
getDescriptionin interfaceWindowAssigner
-
withEventTime
public InternalTimeWindowAssigner withEventTime()
- Specified by:
withEventTimein interfaceInternalTimeWindowAssigner- Returns:
- an InternalTimeWindowAssigner which in event time mode.
-
withProcessingTime
public InternalTimeWindowAssigner withProcessingTime()
- Specified by:
withProcessingTimein interfaceInternalTimeWindowAssigner- Returns:
- an InternalTimeWindowAssigner which in processing time mode.
-
mergeWindows
public void mergeWindows(TimeWindow newWindow, NavigableSet<TimeWindow> sortedWindows, MergeCallback<TimeWindow,Collection<TimeWindow>> callback)
Description copied from class:MergingWindowAssignerDetermines which windows (if any) should be merged.- Specified by:
mergeWindowsin classMergingWindowAssigner<TimeWindow>- Parameters:
newWindow- The new windowsortedWindows- The sorted window candidates.callback- A callback that can be invoked to signal which windows should be merged.
-
-