@Internal public interface SliceAssigner extends Serializable
SliceAssigner
assigns element into a single slice. Note that we use the slice end
timestamp to identify a slice.
Note: SliceAssigner
servers as a base interface. Concrete assigners should implement
interface SliceSharedAssigner
or SliceUnsharedAssigner
.
for more definition of slice.
Modifier and Type | Method and 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.
|
long |
getLastWindowEnd(long sliceEnd)
Returns the last window which the slice belongs to.
|
long |
getSliceEndInterval()
Returns the interval of slice ends, i.e.
|
long |
getWindowStart(long windowEnd)
Returns the corresponding window start timestamp of the given window end timestamp.
|
boolean |
isEventTime()
Returns
true if elements are assigned to windows based on event time, false
based on processing time. |
long assignSliceEnd(RowData element, ClockService clock)
element
- the element to which slice should belong to.clock
- the service to get current processing time.long getLastWindowEnd(long sliceEnd)
long getWindowStart(long windowEnd)
Iterable<Long> expiredSlices(long windowEnd)
windowEnd
- the end timestamp of window emitted.long getSliceEndInterval()
boolean isEventTime()
true
if elements are assigned to windows based on event time, false
based on processing time.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.