Class AsyncStateSliceSharedWindowAggProcessor

All Implemented Interfaces:
Serializable, AsyncMergeCallback<Long,Iterable<Long>>, AsyncStateWindowProcessor<Long>, AsyncStateSlicingWindowProcessor<Long>, WindowProcessor<Long,AsyncStateWindowProcessor.AsyncStateContext<Long>>

public final class AsyncStateSliceSharedWindowAggProcessor extends AbstractAsyncStateSliceWindowAggProcessor implements AsyncMergeCallback<Long,Iterable<Long>>
A window aggregate processor implementation which works for SliceSharedAssigner with async state api, e.g. hopping windows and cumulative windows.
See Also:
  • Constructor Details

  • Method Details

    • fireWindow

      public org.apache.flink.api.common.state.v2.StateFuture<Void> fireWindow(long timerTimestamp, Long windowEnd) throws Exception
      Description copied from interface: AsyncStateWindowProcessor
      Emit results of the given window.

      Note: the key context has been set.

      Specified by:
      fireWindow in interface AsyncStateWindowProcessor<Long>
      Parameters:
      timerTimestamp - the fired timestamp
      windowEnd - the window to emit
      Throws:
      Exception
    • asyncMerge

      public org.apache.flink.api.common.state.v2.StateFuture<org.apache.flink.api.java.tuple.Tuple2<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>> asyncMerge(@Nullable Long mergeResult, Iterable<Long> toBeMerged, Long resultNamespace) throws Exception
      Description copied from interface: AsyncMergeCallback
      Specifies that states of the given windows or slices should be merged into the result window or slice.
      Specified by:
      asyncMerge in interface AsyncMergeCallback<Long,Iterable<Long>>
      Parameters:
      mergeResult - The resulting merged window or slice, null if it represents a non-state namespace.
      toBeMerged - Windows or slices that should be merged into one window or slice.
      resultNamespace - The window or slice used as namespace to get the result from the merged accumulator.
      Returns:
      f0 is the accumulators after merging, f1 is the result of the aggregation from the merged accumulators with this slice end as namespace
      Throws:
      Exception
    • sliceStateMergeTarget

      protected org.apache.flink.api.common.state.v2.StateFuture<Long> sliceStateMergeTarget(long sliceToMerge) throws Exception
      Description copied from class: AbstractAsyncStateSliceWindowAggProcessor
      Returns 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 given sliceToMerge. For shared windows, the merge target should be the shared slice state.
      Specified by:
      sliceStateMergeTarget in class AbstractAsyncStateSliceWindowAggProcessor
      Throws:
      Exception
      See Also: