Class SliceSharedWindowAggProcessor
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractWindowAggProcessor
-
- org.apache.flink.table.runtime.operators.aggregate.window.processors.SliceSharedWindowAggProcessor
-
- All Implemented Interfaces:
Serializable,SliceSharedAssigner.MergeCallback,SlicingWindowProcessor<Long>
public final class SliceSharedWindowAggProcessor extends AbstractWindowAggProcessor implements SliceSharedAssigner.MergeCallback
An window aggregate processor implementation which works forSliceSharedAssigner, e.g. hopping windows and cumulative windows.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.slicing.SlicingWindowProcessor
SlicingWindowProcessor.Context<W>
-
-
Field Summary
-
Fields inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractWindowAggProcessor
accSerializer, aggregator, clockService, ctx, currentProgress, genAggsHandler, isEventTime, reuseOutput, shiftTimeZone, sliceAssigner, useDayLightSaving, windowBuffer, windowBufferFactory, windowInterval, windowState, windowTimerService
-
-
Constructor Summary
Constructors Constructor Description SliceSharedWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler, WindowBuffer.Factory bufferFactory, SliceSharedAssigner sliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, int indexOfCountStar, java.time.ZoneId shiftTimeZone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfireWindow(Long windowEnd)Emit results of the given window.voidmerge(Long mergeResult, Iterable<Long> toBeMerged)Specifies that states of the given slices should be merged into the result slice.protected longsliceStateMergeTarget(long sliceToMerge)Returns the slice state target to merge the given slice into when firing windows.-
Methods inherited from class org.apache.flink.table.runtime.operators.aggregate.window.processors.AbstractWindowAggProcessor
advanceProgress, clearWindow, close, collect, createWindowSerializer, initializeWatermark, open, prepareCheckpoint, processElement
-
-
-
-
Constructor Detail
-
SliceSharedWindowAggProcessor
public SliceSharedWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler, WindowBuffer.Factory bufferFactory, SliceSharedAssigner sliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, int indexOfCountStar, java.time.ZoneId shiftTimeZone)
-
-
Method Detail
-
fireWindow
public void fireWindow(Long windowEnd) throws Exception
Description copied from interface:SlicingWindowProcessorEmit results of the given window.Note: the key context has been set.
- Specified by:
fireWindowin interfaceSlicingWindowProcessor<Long>- Parameters:
windowEnd- the window to emit- Throws:
Exception
-
merge
public void merge(@Nullable Long mergeResult, Iterable<Long> toBeMerged) throws Exception
Description copied from interface:SliceSharedAssigner.MergeCallbackSpecifies that states of the given slices should be merged into the result slice.- Specified by:
mergein interfaceSliceSharedAssigner.MergeCallback- Parameters:
mergeResult- The resulting merged slice,nullif it represents a non-state namespace.toBeMerged- The list of slices that should be merged into one slice.- Throws:
Exception
-
sliceStateMergeTarget
protected long sliceStateMergeTarget(long sliceToMerge) throws ExceptionDescription copied from class:AbstractWindowAggProcessorReturns the slice state target to merge the given slice into when firing windows. For unshared windows, there should no merging happens, so the merge target should be just the givensliceToMerge. For shared windows, the merge target should be the shared slice state.- Specified by:
sliceStateMergeTargetin classAbstractWindowAggProcessor- Throws:
Exception- See Also:
SliceSharedAssigner.mergeSlices(long, SliceSharedAssigner.MergeCallback)
-
-