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
The
UnsliceAssigner for elements have been merged into unslicing windows and attached
window start and end timestamps.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWindowedUnsliceAssigner(int windowStartIndex, int windowEndIndex, UnsliceAssigner<TimeWindow> innerAssigner) -
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.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.Returns a description of this window assigner.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.booleanReturnstrueif 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.toString()Methods inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.assigners.GroupWindowAssigner
open
-
Constructor Details
-
WindowedUnsliceAssigner
public WindowedUnsliceAssigner(int windowStartIndex, int windowEndIndex, UnsliceAssigner<TimeWindow> innerAssigner)
-
-
Method Details
-
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
-
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
- Specified by:
toStringin classGroupWindowAssigner<TimeWindow>
-
getDescription
Description copied from interface:WindowAssignerReturns a description of this window assigner.- Specified by:
getDescriptionin interfaceWindowAssigner
-
withEventTime
- Specified by:
withEventTimein interfaceInternalTimeWindowAssigner- Returns:
- an InternalTimeWindowAssigner which in event time mode.
-
withProcessingTime
- Specified by:
withProcessingTimein interfaceInternalTimeWindowAssigner- Returns:
- an InternalTimeWindowAssigner which in processing time mode.
-