Class 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 Detail

      • aggregateFunction

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

      • AbstractAggregatingState

        public AbstractAggregatingState​(StateRequestHandler stateRequestHandler,
                                        org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT> aggregateFunction,
                                        org.apache.flink.api.common.typeutils.TypeSerializer<ACC> valueSerializer)
        Creates a new AbstractKeyedState with the given asyncExecutionController and stateDescriptor.
        Parameters:
        stateRequestHandler - The async request handler for handling all requests.
        valueSerializer - The type serializer for the values in the state.
    • Method Detail

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