public class CumulativeWindowAssigner extends PanedWindowAssigner<TimeWindow> implements InternalTimeWindowAssigner
WindowAssigner that windows elements into cumulative windows based on the timestamp of
the elements. Windows are overlap.| 限定符 | 构造器和说明 |
|---|---|
protected |
CumulativeWindowAssigner(long maxSize,
long step,
long offset,
boolean isEventTime) |
| 限定符和类型 | 方法和说明 |
|---|---|
TimeWindow |
assignPane(Object element,
long timestamp)
Given the timestamp and element, returns the pane into which it should be placed.
|
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.
|
TimeWindow |
getLastWindow(TimeWindow pane)
Gets the last window which the pane belongs to.
|
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. |
static CumulativeWindowAssigner |
of(java.time.Duration maxSize,
java.time.Duration step)
Creates a new
CumulativeWindowAssigner that assigns elements to cumulative time
windows based on the element timestamp. |
Iterable<TimeWindow> |
splitIntoPanes(TimeWindow window)
Splits the given window into panes collection.
|
String |
toString() |
CumulativeWindowAssigner |
withEventTime() |
CumulativeWindowAssigner |
withOffset(java.time.Duration offset) |
CumulativeWindowAssigner |
withProcessingTime() |
openprotected CumulativeWindowAssigner(long maxSize,
long step,
long offset,
boolean isEventTime)
public Collection<TimeWindow> assignWindows(org.apache.flink.table.data.RowData element, long timestamp)
WindowAssignerassignWindows 在类中 WindowAssigner<TimeWindow>element - The element to which windows should be assigned.timestamp - The timestamp of the element when WindowAssigner.isEventTime() returns true, or
the current system time when WindowAssigner.isEventTime() returns false. The timestamp value is
mapping to UTC milliseconds for splitting windows simply.public TimeWindow assignPane(Object element, long timestamp)
PanedWindowAssignerassignPane 在类中 PanedWindowAssigner<TimeWindow>element - The element to which windows should be assigned.timestamp - The timestamp of the element when WindowAssigner.isEventTime() returns true, or
the current system time when WindowAssigner.isEventTime() returns false.public Iterable<TimeWindow> splitIntoPanes(TimeWindow window)
PanedWindowAssignersplitIntoPanes 在类中 PanedWindowAssigner<TimeWindow>window - the window to be split.public TimeWindow getLastWindow(TimeWindow pane)
PanedWindowAssignergetLastWindow 在类中 PanedWindowAssigner<TimeWindow>public org.apache.flink.api.common.typeutils.TypeSerializer<TimeWindow> getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
WindowAssignerTypeSerializer for serializing windows that are assigned by this WindowAssigner.getWindowSerializer 在类中 WindowAssigner<TimeWindow>public boolean isEventTime()
WindowAssignertrue if elements are assigned to windows based on event time, false
otherwise.isEventTime 在类中 WindowAssigner<TimeWindow>public String toString()
toString 在类中 WindowAssigner<TimeWindow>public static CumulativeWindowAssigner of(java.time.Duration maxSize, java.time.Duration step)
CumulativeWindowAssigner that assigns elements to cumulative time
windows based on the element timestamp.maxSize - The max size of the generated windows.step - The step interval for window size to increase of the generated windows.public CumulativeWindowAssigner withOffset(java.time.Duration offset)
public CumulativeWindowAssigner withEventTime()
withEventTime 在接口中 InternalTimeWindowAssignerpublic CumulativeWindowAssigner withProcessingTime()
withProcessingTime 在接口中 InternalTimeWindowAssignerCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.