Class CumulativeWindowAssigner
java.lang.Object
org.apache.flink.table.runtime.operators.window.groupwindow.assigners.GroupWindowAssigner<W>
org.apache.flink.table.runtime.operators.window.groupwindow.assigners.PanedWindowAssigner<TimeWindow>
org.apache.flink.table.runtime.operators.window.groupwindow.assigners.CumulativeWindowAssigner
- All Implemented Interfaces:
Serializable,InternalTimeWindowAssigner
public class CumulativeWindowAssigner
extends PanedWindowAssigner<TimeWindow>
implements InternalTimeWindowAssigner
A
GroupWindowAssigner that windows elements into cumulative windows based on the
timestamp of the elements. Windows are overlap.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCumulativeWindowAssigner(long maxSize, long step, long offset, boolean isEventTime) -
Method Summary
Modifier and TypeMethodDescriptionassignPane(Object element, long timestamp) Given the timestamp and element, returns the pane into which it should be placed.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.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 aTypeSerializerfor serializing windows that are assigned by thisWindowAssigner.booleanReturnstrueif elements are assigned to windows based on event time,falseotherwise.static CumulativeWindowAssignerCreates a newCumulativeWindowAssignerthat assigns elements to cumulative time windows based on the element timestamp.splitIntoPanes(TimeWindow window) Splits the given window into panes collection.toString()withOffset(Duration offset) Methods inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.assigners.GroupWindowAssigner
open
-
Constructor Details
-
CumulativeWindowAssigner
protected CumulativeWindowAssigner(long maxSize, long step, long offset, boolean isEventTime)
-
-
Method Details
-
assignWindows
public Collection<TimeWindow> assignWindows(org.apache.flink.table.data.RowData element, long timestamp) 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.
-
assignPane
Description copied from class:PanedWindowAssignerGiven the timestamp and element, returns the pane into which it should be placed.- Specified by:
assignPanein classPanedWindowAssigner<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.
-
splitIntoPanes
Description copied from class:PanedWindowAssignerSplits the given window into panes collection.- Specified by:
splitIntoPanesin classPanedWindowAssigner<TimeWindow>- Parameters:
window- the window to be split.- Returns:
- the panes iterable
-
getLastWindow
Description copied from class:PanedWindowAssignerGets the last window which the pane belongs to.- Specified by:
getLastWindowin classPanedWindowAssigner<TimeWindow>
-
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>
-
isEventTime
public boolean isEventTime()Description copied from class:GroupWindowAssignerReturnstrueif elements are assigned to windows based on event time,falseotherwise.- Specified by:
isEventTimein classGroupWindowAssigner<TimeWindow>
-
toString
- Specified by:
toStringin classGroupWindowAssigner<TimeWindow>
-
of
Creates a newCumulativeWindowAssignerthat assigns elements to cumulative time windows based on the element timestamp.- Parameters:
maxSize- The max size of the generated windows.step- The step interval for window size to increase of the generated windows.- Returns:
- The time policy.
-
withOffset
-
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.
-