Interface AsyncStateWindowProcessor<W>

All Superinterfaces:
Serializable, WindowProcessor<W,AsyncStateWindowProcessor.AsyncStateContext<W>>
All Known Subinterfaces:
AsyncStateSlicingWindowProcessor<W>
All Known Implementing Classes:
AbstractAsyncStateSliceWindowAggProcessor, AbstractAsyncStateWindowAggProcessor, AsyncStateSliceSharedWindowAggProcessor, AsyncStateSliceUnsharedWindowAggProcessor

@Internal public interface AsyncStateWindowProcessor<W> extends WindowProcessor<W,AsyncStateWindowProcessor.AsyncStateContext<W>>
A processor that processes elements for windows with async state.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Information available in an invocation of methods of AsyncStateWindowProcessor.

    Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowProcessor

    WindowProcessor.Context<W>
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.flink.api.common.state.v2.StateFuture<Void>
    advanceProgress(org.apache.flink.table.data.RowData currentKey, 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.
    org.apache.flink.api.common.state.v2.StateFuture<Void>
    clearWindow(long timerTimestamp, W window)
    Clear state and resources associated with the given window namespace.
    org.apache.flink.api.common.state.v2.StateFuture<Void>
    fireWindow(long timerTimestamp, W window)
    Emit results of the given window.
    org.apache.flink.api.common.state.v2.StateFuture<Void>
    Performs a preparation before checkpoint.
    org.apache.flink.api.common.state.v2.StateFuture<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.

    Methods inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowProcessor

    close, createWindowSerializer, initializeWatermark, open
  • Method Details

    • processElement

      org.apache.flink.api.common.state.v2.StateFuture<Boolean> processElement(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element) throws Exception
      Process an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.
      Parameters:
      key - the key associated with the element
      element - The element to process.
      Throws:
      Exception
    • advanceProgress

      org.apache.flink.api.common.state.v2.StateFuture<Void> advanceProgress(@Nullable org.apache.flink.table.data.RowData currentKey, long progress) throws Exception
      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.

      This 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.

      Note: There may be multiple different keys within the buffer. When flushing them to the async state, only the async state request for the current key of the operator will be returned as a StateFuture. Requests for async states for other keys will not be waited on.

      Parameters:
      currentKey - the current key of the operator used to return the result of accessing async state associated with the same key. If it is null, it means that the returns of asynchronous state requests for all keys will not be awaited.
      progress - the current progress time
      Returns:
      the future of the flush operation about current key if the current key is not null, else a StateFutureUtils.completedVoidFuture() will be returned.
      Throws:
      Exception
    • prepareCheckpoint

      org.apache.flink.api.common.state.v2.StateFuture<Void> prepareCheckpoint() throws Exception
      Performs a preparation before checkpoint. This usually flushes buffered data into state.
      Throws:
      Exception
    • fireWindow

      org.apache.flink.api.common.state.v2.StateFuture<Void> fireWindow(long timerTimestamp, W window) throws Exception
      Emit results of the given window.

      Note: the key context has been set.

      Parameters:
      timerTimestamp - the fired timestamp
      window - the window to emit
      Throws:
      Exception
    • clearWindow

      org.apache.flink.api.common.state.v2.StateFuture<Void> clearWindow(long timerTimestamp, W window) throws Exception
      Clear state and resources associated with the given window namespace.

      Note: the key context has been set.

      Parameters:
      timerTimestamp - the fired timestamp
      window - the window to clear
      Throws:
      Exception