Class CumulativeWindowAssigner
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.assigners.WindowAssigner<W>
-
- org.apache.flink.table.runtime.operators.window.assigners.PanedWindowAssigner<TimeWindow>
-
- org.apache.flink.table.runtime.operators.window.assigners.CumulativeWindowAssigner
-
- All Implemented Interfaces:
Serializable,InternalTimeWindowAssigner
public class CumulativeWindowAssigner extends PanedWindowAssigner<TimeWindow> implements InternalTimeWindowAssigner
AWindowAssignerthat windows elements into cumulative windows based on the timestamp of the elements. Windows are overlap.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCumulativeWindowAssigner(long maxSize, long step, long offset, boolean isEventTime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeWindowassignPane(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.TimeWindowgetLastWindow(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.booleanisEventTime()Returnstrueif elements are assigned to windows based on event time,falseotherwise.static CumulativeWindowAssignerof(java.time.Duration maxSize, java.time.Duration step)Creates a newCumulativeWindowAssignerthat assigns elements to cumulative time windows based on the element timestamp.Iterable<TimeWindow>splitIntoPanes(TimeWindow window)Splits the given window into panes collection.StringtoString()CumulativeWindowAssignerwithEventTime()CumulativeWindowAssignerwithOffset(java.time.Duration offset)CumulativeWindowAssignerwithProcessingTime()-
Methods inherited from class org.apache.flink.table.runtime.operators.window.assigners.WindowAssigner
open
-
-
-
-
Method Detail
-
assignWindows
public Collection<TimeWindow> assignWindows(org.apache.flink.table.data.RowData element, long timestamp)
Description copied from class:WindowAssignerGiven the timestamp and element, returns the set of windows into which it should be placed.- Specified by:
assignWindowsin classWindowAssigner<TimeWindow>- Parameters:
element- The element to which windows should be assigned.timestamp- The timestamp of the element whenWindowAssigner.isEventTime()returns true, or the current system time whenWindowAssigner.isEventTime()returns false. The timestamp value is mapping to UTC milliseconds for splitting windows simply.
-
assignPane
public TimeWindow assignPane(Object element, long timestamp)
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 whenWindowAssigner.isEventTime()returns true, or the current system time whenWindowAssigner.isEventTime()returns false.
-
splitIntoPanes
public Iterable<TimeWindow> splitIntoPanes(TimeWindow window)
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
public TimeWindow getLastWindow(TimeWindow pane)
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:WindowAssignerReturns aTypeSerializerfor serializing windows that are assigned by thisWindowAssigner.- Specified by:
getWindowSerializerin classWindowAssigner<TimeWindow>
-
isEventTime
public boolean isEventTime()
Description copied from class:WindowAssignerReturnstrueif elements are assigned to windows based on event time,falseotherwise.- Specified by:
isEventTimein classWindowAssigner<TimeWindow>
-
toString
public String toString()
- Specified by:
toStringin classWindowAssigner<TimeWindow>
-
of
public static CumulativeWindowAssigner of(java.time.Duration maxSize, java.time.Duration step)
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
public CumulativeWindowAssigner withOffset(java.time.Duration offset)
-
withEventTime
public CumulativeWindowAssigner withEventTime()
- Specified by:
withEventTimein interfaceInternalTimeWindowAssigner- Returns:
- an InternalTimeWindowAssigner which in event time mode.
-
withProcessingTime
public CumulativeWindowAssigner withProcessingTime()
- Specified by:
withProcessingTimein interfaceInternalTimeWindowAssigner- Returns:
- an InternalTimeWindowAssigner which in processing time mode.
-
-