public final class SliceSharedWindowAggProcessor extends AbstractWindowAggProcessor implements SliceSharedAssigner.MergeCallback
SliceSharedAssigner
, e.g.
hopping windows and cumulative windows.SlicingWindowProcessor.Context<W>
accSerializer, aggregator, clockService, ctx, currentProgress, genAggsHandler, isEventTime, reuseOutput, shiftTimeZone, sliceAssigner, useDayLightSaving, windowBuffer, windowBufferFactory, windowInterval, windowState, windowTimerService
Constructor and Description |
---|
SliceSharedWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler,
WindowBuffer.Factory bufferFactory,
SliceSharedAssigner sliceAssigner,
TypeSerializer<RowData> accSerializer,
int indexOfCountStar,
java.time.ZoneId shiftTimeZone) |
Modifier and Type | Method and Description |
---|---|
void |
fireWindow(Long windowEnd)
Emit results of the given window.
|
void |
merge(Long mergeResult,
Iterable<Long> toBeMerged)
Specifies that states of the given slices should be merged into the result slice.
|
protected long |
sliceStateMergeTarget(long sliceToMerge)
Returns the slice state target to merge the given slice into when firing windows.
|
advanceProgress, clearWindow, close, collect, createWindowSerializer, open, prepareCheckpoint, processElement
public SliceSharedWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler, WindowBuffer.Factory bufferFactory, SliceSharedAssigner sliceAssigner, TypeSerializer<RowData> accSerializer, int indexOfCountStar, java.time.ZoneId shiftTimeZone)
public void fireWindow(Long windowEnd) throws Exception
SlicingWindowProcessor
Note: the key context has been set.
fireWindow
in interface SlicingWindowProcessor<Long>
windowEnd
- the window to emitException
public void merge(@Nullable Long mergeResult, Iterable<Long> toBeMerged) throws Exception
SliceSharedAssigner.MergeCallback
merge
in interface SliceSharedAssigner.MergeCallback
mergeResult
- The resulting merged slice, null
if it represents a non-state
namespace.toBeMerged
- The list of slices that should be merged into one slice.Exception
protected long sliceStateMergeTarget(long sliceToMerge) throws Exception
AbstractWindowAggProcessor
sliceToMerge
. For shared windows, the merge target should be the shared slice
state.sliceStateMergeTarget
in class AbstractWindowAggProcessor
Exception
SliceSharedAssigner.mergeSlices(long, SliceSharedAssigner.MergeCallback)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.