public static final class SliceAssigners.WindowedSliceAssigner extends Object implements SliceUnsharedAssigner
SliceAssigner
for elements have been attached window start and end timestamps.Constructor and Description |
---|
WindowedSliceAssigner(int windowEndIndex,
SliceAssigner innerAssigner) |
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. |
public WindowedSliceAssigner(int windowEndIndex, SliceAssigner innerAssigner)
public long assignSliceEnd(RowData element, ClockService clock)
SliceAssigner
assignSliceEnd
in interface SliceAssigner
element
- the element to which slice should belong to.clock
- the service to get current processing time.public long getLastWindowEnd(long sliceEnd)
SliceAssigner
getLastWindowEnd
in interface SliceAssigner
public long getWindowStart(long windowEnd)
SliceAssigner
getWindowStart
in interface SliceAssigner
public Iterable<Long> expiredSlices(long windowEnd)
SliceAssigner
expiredSlices
in interface SliceAssigner
windowEnd
- the end timestamp of window emitted.public long getSliceEndInterval()
SliceAssigner
getSliceEndInterval
in interface SliceAssigner
public boolean isEventTime()
SliceAssigner
true
if elements are assigned to windows based on event time, false
based on processing time.isEventTime
in interface SliceAssigner
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.