public static class UnsliceAssigners.WindowedUnsliceAssigner extends MergingWindowAssigner<TimeWindow> implements UnsliceAssigner<TimeWindow>, InternalTimeWindowAssigner
UnsliceAssigner for elements have been merged into unslicing windows and attached
window start and end timestamps.| Constructor and Description |
|---|
WindowedUnsliceAssigner(int windowStartIndex,
int windowEndIndex,
UnsliceAssigner<TimeWindow> innerAssigner) |
| 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. |
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.
|
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. |
org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow> |
getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
Returns a
TypeSerializer for serializing windows that are assigned by this WindowAssigner. |
boolean |
isEventTime()
Returns
true if elements are assigned to windows based on event time, false
otherwise. |
void |
mergeWindows(TimeWindow newWindow,
NavigableSet<TimeWindow> sortedWindows,
MergeCallback<TimeWindow,Collection<TimeWindow>> callback)
Determines which windows (if any) should be merged.
|
String |
toString() |
InternalTimeWindowAssigner |
withEventTime() |
InternalTimeWindowAssigner |
withProcessingTime() |
openpublic WindowedUnsliceAssigner(int windowStartIndex,
int windowEndIndex,
UnsliceAssigner<TimeWindow> innerAssigner)
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.Exceptionpublic MergingWindowAssigner<TimeWindow> getMergingWindowAssigner()
UnsliceAssignerMergingWindowAssigner to reuse the logic in
GroupWindowAssigner to
merge windows.getMergingWindowAssigner in interface UnsliceAssigner<TimeWindow>public boolean isEventTime()
GroupWindowAssignertrue if elements are assigned to windows based on event time, false
otherwise.isEventTime in interface WindowAssignerisEventTime in class GroupWindowAssigner<TimeWindow>public Collection<TimeWindow> assignWindows(org.apache.flink.table.data.RowData element, long timestamp) throws IOException
GroupWindowAssignerassignWindows in class GroupWindowAssigner<TimeWindow>element - The element to which windows should be assigned.timestamp - The timestamp of the element when GroupWindowAssigner.isEventTime() returns true, or
the current system time when GroupWindowAssigner.isEventTime() returns false. The timestamp value is
mapping to UTC milliseconds for splitting windows simply.IOExceptionpublic org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow> getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
GroupWindowAssignerTypeSerializer for serializing windows that are assigned by this WindowAssigner.getWindowSerializer in class GroupWindowAssigner<TimeWindow>public String toString()
toString in class GroupWindowAssigner<TimeWindow>public String getDescription()
WindowAssignergetDescription in interface WindowAssignerpublic InternalTimeWindowAssigner withEventTime()
withEventTime in interface InternalTimeWindowAssignerpublic InternalTimeWindowAssigner withProcessingTime()
withProcessingTime in interface InternalTimeWindowAssignerpublic void mergeWindows(TimeWindow newWindow, NavigableSet<TimeWindow> sortedWindows, MergeCallback<TimeWindow,Collection<TimeWindow>> callback)
MergingWindowAssignermergeWindows in class MergingWindowAssigner<TimeWindow>newWindow - The new windowsortedWindows - The sorted window candidates.callback - A callback that can be invoked to signal which windows should be merged.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.