Class AbstractAggregatingState<K,N,IN,ACC,OUT>

java.lang.Object
org.apache.flink.runtime.state.v2.AbstractKeyedState<K,N,ACC>
org.apache.flink.runtime.state.v2.AbstractAggregatingState<K,N,IN,ACC,OUT>
Type Parameters:
K - The type of key the state is associated to.
IN - The type of the values that are added into the state.
ACC - TThe type of the accumulator (intermediate aggregation state).
OUT - The type of the values that are returned from the state.
All Implemented Interfaces:
org.apache.flink.api.common.state.v2.AggregatingState<IN,OUT>, org.apache.flink.api.common.state.v2.AppendingState<IN,OUT,OUT>, org.apache.flink.api.common.state.v2.MergingState<IN,OUT,OUT>, org.apache.flink.api.common.state.v2.State, InternalAggregatingState<K,N,IN,ACC,OUT>, InternalAppendingState<K,N,IN,ACC,OUT,OUT>, InternalKeyedState<K,N,ACC>, InternalMergingState<K,N,IN,ACC,OUT,OUT>, InternalPartitionedState<N>, InternalStateAccessible<ACC>

public class AbstractAggregatingState<K,N,IN,ACC,OUT> extends AbstractKeyedState<K,N,ACC> implements InternalAggregatingState<K,N,IN,ACC,OUT>
The default implementation of AggregatingState, which delegates all async requests to StateRequestHandler.
  • Field Details

    • aggregateFunction

      protected final org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> aggregateFunction
  • Constructor Details

    • AbstractAggregatingState

      public AbstractAggregatingState(StateRequestHandler stateRequestHandler, org.apache.flink.api.common.state.v2.AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor)
      Creates a new AbstractKeyedState with the given asyncExecutionController and stateDescriptor.
      Parameters:
      stateRequestHandler - The async request handler for handling all requests.
      stateDescriptor - The properties of the state.
  • Method Details

    • asyncGet

      public org.apache.flink.api.common.state.v2.StateFuture<OUT> asyncGet()
      Specified by:
      asyncGet in interface org.apache.flink.api.common.state.v2.AppendingState<K,N,IN>
    • asyncAdd

      public org.apache.flink.api.common.state.v2.StateFuture<Void> asyncAdd(IN value)
      Specified by:
      asyncAdd in interface org.apache.flink.api.common.state.v2.AppendingState<K,N,IN>
    • asyncGetInternal

      public org.apache.flink.api.common.state.v2.StateFuture<ACC> asyncGetInternal()
      Description copied from interface: InternalStateAccessible
      Get internally stored value.
      Specified by:
      asyncGetInternal in interface InternalStateAccessible<K>
      Returns:
      internally stored value.
    • asyncUpdateInternal

      public org.apache.flink.api.common.state.v2.StateFuture<Void> asyncUpdateInternal(ACC valueToStore)
      Description copied from interface: InternalStateAccessible
      Update internally stored value.
      Specified by:
      asyncUpdateInternal in interface InternalStateAccessible<K>
      Parameters:
      valueToStore - new value to store.
    • get

      public OUT get()
      Specified by:
      get in interface org.apache.flink.api.common.state.v2.AppendingState<K,N,IN>
    • add

      public void add(IN value)
      Specified by:
      add in interface org.apache.flink.api.common.state.v2.AppendingState<K,N,IN>
    • asyncMergeNamespaces

      public org.apache.flink.api.common.state.v2.StateFuture<Void> asyncMergeNamespaces(N target, Collection<N> sources)
      Description copied from interface: InternalMergingState
      Merges the state of the current key for the given source namespaces into the state of the target namespace.
      Specified by:
      asyncMergeNamespaces in interface InternalMergingState<K,N,IN,ACC,OUT,OUT>
      Parameters:
      target - The target namespace where the merged state should be stored.
      sources - The source namespaces whose state should be merged.
    • mergeNamespaces

      public void mergeNamespaces(N target, Collection<N> sources)
      Description copied from interface: InternalMergingState
      Merges the state of the current key for the given source namespaces into the state of the target namespace.
      Specified by:
      mergeNamespaces in interface InternalMergingState<K,N,IN,ACC,OUT,OUT>
      Parameters:
      target - The target namespace where the merged state should be stored.
      sources - The source namespaces whose state should be merged.
    • getInternal

      public ACC getInternal()
      Description copied from interface: InternalStateAccessible
      Get internally stored value.
      Specified by:
      getInternal in interface InternalStateAccessible<K>
      Returns:
      internally stored value.
    • updateInternal

      public void updateInternal(ACC valueToStore)
      Description copied from interface: InternalStateAccessible
      Update internally stored value.
      Specified by:
      updateInternal in interface InternalStateAccessible<K>
      Parameters:
      valueToStore - new value to store.