public abstract class AbstractWindowAggProcessor extends Object implements SlicingWindowProcessor<Long>
SlicingWindowProcessor for window aggregate.SlicingWindowProcessor.Context<W>| 限定符和类型 | 字段和说明 |
|---|---|
protected org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> |
accSerializer |
protected NamespaceAggsHandleFunction<Long> |
aggregator |
protected ClockService |
clockService |
protected SlicingWindowProcessor.Context<Long> |
ctx |
protected long |
currentProgress |
protected GeneratedNamespaceAggsHandleFunction<Long> |
genAggsHandler |
protected boolean |
isEventTime |
protected org.apache.flink.table.data.utils.JoinedRowData |
reuseOutput |
protected java.time.ZoneId |
shiftTimeZone |
protected SliceAssigner |
sliceAssigner |
protected boolean |
useDayLightSaving
The shift timezone is using DayLightSaving time or not.
|
protected WindowBuffer |
windowBuffer |
protected WindowBuffer.Factory |
windowBufferFactory |
protected long |
windowInterval |
protected WindowValueState<Long> |
windowState
state schema: [key, window_end, accumulator].
|
protected WindowTimerService<Long> |
windowTimerService |
| 构造器和说明 |
|---|
AbstractWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler,
WindowBuffer.Factory bufferFactory,
SliceAssigner sliceAssigner,
org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer,
java.time.ZoneId shiftTimeZone) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
advanceProgress(long progress)
Advances the progress time, the progress time is watermark if working in event-time mode, or
current processing time if working in processing-time mode.
|
void |
clearWindow(Long windowEnd)
Clear state and resources associated with the given window namespace.
|
void |
close()
The tear-down method of the function.
|
protected void |
collect(org.apache.flink.table.data.RowData aggResult) |
org.apache.flink.api.common.typeutils.TypeSerializer<Long> |
createWindowSerializer()
Returns the serializer of the window type.
|
void |
open(SlicingWindowProcessor.Context<Long> context)
Initialization method for the function.
|
void |
prepareCheckpoint()
Performs a preparation before checkpoint.
|
boolean |
processElement(org.apache.flink.table.data.RowData key,
org.apache.flink.table.data.RowData element)
Process an element with associated key from the input stream.
|
protected abstract long |
sliceStateMergeTarget(long sliceToMerge)
Returns the slice state target to merge the given slice into when firing windows.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfireWindowprotected final GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler
protected final WindowBuffer.Factory windowBufferFactory
protected final SliceAssigner sliceAssigner
protected final org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer
protected final boolean isEventTime
protected final long windowInterval
protected final java.time.ZoneId shiftTimeZone
protected final boolean useDayLightSaving
protected transient long currentProgress
protected transient SlicingWindowProcessor.Context<Long> ctx
protected transient ClockService clockService
protected transient WindowTimerService<Long> windowTimerService
protected transient NamespaceAggsHandleFunction<Long> aggregator
protected transient WindowBuffer windowBuffer
protected transient WindowValueState<Long> windowState
protected transient org.apache.flink.table.data.utils.JoinedRowData reuseOutput
public AbstractWindowAggProcessor(GeneratedNamespaceAggsHandleFunction<Long> genAggsHandler, WindowBuffer.Factory bufferFactory, SliceAssigner sliceAssigner, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, java.time.ZoneId shiftTimeZone)
public void open(SlicingWindowProcessor.Context<Long> context) throws Exception
SlicingWindowProcessoropen 在接口中 SlicingWindowProcessor<Long>Exceptionpublic boolean processElement(org.apache.flink.table.data.RowData key,
org.apache.flink.table.data.RowData element)
throws Exception
SlicingWindowProcessorprocessElement 在接口中 SlicingWindowProcessor<Long>key - the key associated with the elementelement - The element to process.Exceptionprotected abstract long sliceStateMergeTarget(long sliceToMerge)
throws Exception
sliceToMerge. For shared windows, the merge target should be the shared slice
state.public void advanceProgress(long progress)
throws Exception
SlicingWindowProcessorThis will potentially flush buffered data into states, because the watermark advancement may be in a very small step, but we don't need to flush buffered data for every watermark advancement.
advanceProgress 在接口中 SlicingWindowProcessor<Long>progress - the current progress timeExceptionpublic void prepareCheckpoint()
throws Exception
SlicingWindowProcessorprepareCheckpoint 在接口中 SlicingWindowProcessor<Long>Exceptionpublic void clearWindow(Long windowEnd) throws Exception
SlicingWindowProcessorNote: the key context has been set.
clearWindow 在接口中 SlicingWindowProcessor<Long>windowEnd - the window to clearExceptionpublic void close()
throws Exception
SlicingWindowProcessorclose 在接口中 SlicingWindowProcessor<Long>Exceptionpublic org.apache.flink.api.common.typeutils.TypeSerializer<Long> createWindowSerializer()
SlicingWindowProcessorcreateWindowSerializer 在接口中 SlicingWindowProcessor<Long>protected void collect(org.apache.flink.table.data.RowData aggResult)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.