java.lang.Object
org.apache.flink.table.runtime.operators.aggregate.window.processors.WindowAggProcessorBase<W,C>
All Implemented Interfaces:
Serializable, WindowProcessor<W,C>
Direct Known Subclasses:
AbstractAsyncStateWindowAggProcessor, AbstractSyncStateWindowAggProcessor

public abstract class WindowAggProcessorBase<W,C extends WindowProcessor.Context<W>> extends Object implements WindowProcessor<W,C>
See Also:
  • Field Details

    • genAggsHandler

      protected final GeneratedNamespaceAggsHandleFunction<W> genAggsHandler
    • accSerializer

      protected final org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer
    • isEventTime

      protected final boolean isEventTime
    • shiftTimeZone

      protected final ZoneId shiftTimeZone
    • useDayLightSaving

      protected final boolean useDayLightSaving
      The shift timezone is using DayLightSaving time or not.
    • currentProgress

      protected transient long currentProgress
    • ctx

      protected transient C extends WindowProcessor.Context<W> ctx
    • clockService

      protected transient ClockService clockService
    • windowTimerService

      protected transient WindowTimerService<W> windowTimerService
    • aggregator

      protected transient NamespaceAggsHandleFunction<W> aggregator
    • reuseOutput

      protected transient org.apache.flink.table.data.utils.JoinedRowData reuseOutput
  • Constructor Details

    • WindowAggProcessorBase

      public WindowAggProcessorBase(GeneratedNamespaceAggsHandleFunction<W> genAggsHandler, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> accSerializer, boolean isEventTime, ZoneId shiftTimeZone)
  • Method Details

    • open

      public void open(C context) throws Exception
      Description copied from interface: WindowProcessor
      Initialization method for the function. It is called before the actual working methods.
      Specified by:
      open in interface WindowProcessor<W,C extends WindowProcessor.Context<W>>
      Throws:
      Exception
    • initializeWatermark

      public void initializeWatermark(long watermark)
      Description copied from interface: WindowProcessor
      Initializes the watermark which restores from state. The method is called after open method and before the actual working methods.
      Specified by:
      initializeWatermark in interface WindowProcessor<W,C extends WindowProcessor.Context<W>>
      Parameters:
      watermark - the initial watermark
    • close

      public void close() throws Exception
      Description copied from interface: WindowProcessor
      The tear-down method of the function. It is called after the last call to the main working methods.
      Specified by:
      close in interface WindowProcessor<W,C extends WindowProcessor.Context<W>>
      Throws:
      Exception
    • prepareAggregator

      protected abstract void prepareAggregator() throws Exception
      Throws:
      Exception
    • getWindowTimerService

      protected abstract WindowTimerService<W> getWindowTimerService()
    • collect

      protected void collect(org.apache.flink.table.data.RowData currentKey, org.apache.flink.table.data.RowData aggResult)
      Send result to downstream.

      The RowKind of the results is always RowKind.INSERT.

      TODO support early fire / late file to produce changelog result.