public static final class SliceAssigners.SlicedSharedSliceAssigner extends Object implements SliceSharedAssigner
SliceAssigner for elements have been attached slice end timestamp, and the slices
are shared.SliceSharedAssigner.MergeCallback| 构造器和说明 |
|---|
SlicedSharedSliceAssigner(int sliceEndIndex,
SliceSharedAssigner innerAssigner) |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getLastWindowEnd(long sliceEnd)
Returns the last window which the slice belongs to.
|
void |
mergeSlices(long sliceEnd,
SliceSharedAssigner.MergeCallback callback)
Determines which slices (if any) should be merged.
|
Optional<Long> |
nextTriggerWindow(long windowEnd,
java.util.function.Supplier<Boolean> isWindowEmpty)
Returns the optional end timestamp of next window which should be triggered.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitassignSliceEnd, expiredSlices, getSliceEndInterval, getWindowStart, isEventTimepublic SlicedSharedSliceAssigner(int sliceEndIndex,
SliceSharedAssigner innerAssigner)
public void mergeSlices(long sliceEnd,
SliceSharedAssigner.MergeCallback callback)
throws Exception
SliceSharedAssignermergeSlices 在接口中 SliceSharedAssignersliceEnd - the triggered slice, identified by end timestampcallback - a callback that can be invoked to signal which slices should be merged.Exceptionpublic Optional<Long> nextTriggerWindow(long windowEnd, java.util.function.Supplier<Boolean> isWindowEmpty)
SliceSharedAssignerThe purpose of this method is avoid register too many timers for each hopping and
cumulative slice, e.g. HOP(1day, 10s) needs register 8640 timers for every slice. In order to
improve this, we only register one timer for the next window. For hopping windows we don't
register next window if current window is empty (i.e. no records in current window). That
means we will have one more unnecessary window triggered for hopping windows if no elements
arrives for a key for a long time. We will skip to emit window result for the triggered empty
window, see SliceSharedWindowAggProcessor.fireWindow(Long).
nextTriggerWindow 在接口中 SliceSharedAssignerwindowEnd - the current triggered window, identified by end timestampisWindowEmpty - a supplier that can be invoked to get whether the triggered window is
empty (i.e. no records in the window).public long getLastWindowEnd(long sliceEnd)
SliceAssignergetLastWindowEnd 在接口中 SliceAssignerCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.