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.| 构造器和说明 |
|---|
WindowedUnsliceAssigner(int windowStartIndex,
int windowEndIndex,
UnsliceAssigner<TimeWindow> innerAssigner) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 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 在接口中 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 在接口中 UnsliceAssigner<TimeWindow>public boolean isEventTime()
GroupWindowAssignertrue if elements are assigned to windows based on event time, false
otherwise.isEventTime 在接口中 WindowAssignerisEventTime 在类中 GroupWindowAssigner<TimeWindow>public Collection<TimeWindow> assignWindows(org.apache.flink.table.data.RowData element, long timestamp) throws IOException
GroupWindowAssignerassignWindows 在类中 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 在类中 GroupWindowAssigner<TimeWindow>public String toString()
toString 在类中 GroupWindowAssigner<TimeWindow>public String getDescription()
WindowAssignergetDescription 在接口中 WindowAssignerpublic InternalTimeWindowAssigner withEventTime()
withEventTime 在接口中 InternalTimeWindowAssignerpublic InternalTimeWindowAssigner withProcessingTime()
withProcessingTime 在接口中 InternalTimeWindowAssignerpublic void mergeWindows(TimeWindow newWindow, NavigableSet<TimeWindow> sortedWindows, MergeCallback<TimeWindow,Collection<TimeWindow>> callback)
MergingWindowAssignermergeWindows 在类中 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.