Class SliceAssigners.WindowedSliceAssigner
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.tvf.slicing.SliceAssigners.WindowedSliceAssigner
-
- All Implemented Interfaces:
Serializable
,WindowAssigner
,SliceAssigner
,SliceUnsharedAssigner
- Enclosing class:
- SliceAssigners
public static final class SliceAssigners.WindowedSliceAssigner extends Object implements SliceUnsharedAssigner
TheSliceAssigner
for elements have been attached window start and end timestamps.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WindowedSliceAssigner(int windowEndIndex, SliceAssigner innerAssigner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
assignSliceEnd(RowData element, ClockService clock)
Returns the end timestamp of a slice that the given element should belong.Iterable<Long>
expiredSlices(long windowEnd)
Returns an iterator of slices to expire when the given window is emitted.String
getDescription()
Returns a description of this window assigner.long
getLastWindowEnd(long sliceEnd)
Returns the last window which the slice belongs to.long
getSliceEndInterval()
Returns the interval of slice ends, i.e. the step size to advance of the slice end when a new slice assigned.long
getWindowStart(long windowEnd)
Returns the corresponding window start timestamp of the given window end timestamp.boolean
isEventTime()
Returnstrue
if elements are assigned to windows based on event time,false
based on processing time.
-
-
-
Constructor Detail
-
WindowedSliceAssigner
public WindowedSliceAssigner(int windowEndIndex, SliceAssigner innerAssigner)
-
-
Method Detail
-
assignSliceEnd
public long assignSliceEnd(RowData element, ClockService clock)
Description copied from interface:SliceAssigner
Returns the end timestamp of a slice that the given element should belong.- Specified by:
assignSliceEnd
in interfaceSliceAssigner
- Parameters:
element
- the element to which slice should belong to.clock
- the service to get current processing time.
-
getLastWindowEnd
public long getLastWindowEnd(long sliceEnd)
Description copied from interface:SliceAssigner
Returns the last window which the slice belongs to. The window and slices are both identified by the end timestamp.- Specified by:
getLastWindowEnd
in interfaceSliceAssigner
-
getWindowStart
public long getWindowStart(long windowEnd)
Description copied from interface:SliceAssigner
Returns the corresponding window start timestamp of the given window end timestamp.- Specified by:
getWindowStart
in interfaceSliceAssigner
-
expiredSlices
public Iterable<Long> expiredSlices(long windowEnd)
Description copied from interface:SliceAssigner
Returns an iterator of slices to expire when the given window is emitted. The window and slices are both identified by the end timestamp.- Specified by:
expiredSlices
in interfaceSliceAssigner
- Parameters:
windowEnd
- the end timestamp of window emitted.
-
getSliceEndInterval
public long getSliceEndInterval()
Description copied from interface:SliceAssigner
Returns the interval of slice ends, i.e. the step size to advance of the slice end when a new slice assigned.- Specified by:
getSliceEndInterval
in interfaceSliceAssigner
-
isEventTime
public boolean isEventTime()
Description copied from interface:WindowAssigner
Returnstrue
if elements are assigned to windows based on event time,false
based on processing time.- Specified by:
isEventTime
in interfaceWindowAssigner
-
getDescription
public String getDescription()
Description copied from interface:WindowAssigner
Returns a description of this window assigner.- Specified by:
getDescription
in interfaceWindowAssigner
-
-