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

    • Constructor Detail

      • AbstractAggregatingState

        public AbstractAggregatingState​(StateRequestHandler stateRequestHandler,
                                        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 Detail

      • asyncGet

        public StateFuture<OUT> asyncGet()
        Description copied from interface: AppendingState
        Returns the current value for the state asynchronously. When the state is not partitioned the returned value is the same for all inputs in a given operator instance. If state partitioning is applied, the value returned depends on the current operator input, as the operator maintains an independent state for each partition.

        NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null wrapped by a StateFuture.

        Specified by:
        asyncGet in interface AppendingState<K,​N,​IN>
        Returns:
        The operator state value corresponding to the current input or null wrapped by a StateFuture if the state is empty.
      • get

        public OUT get()
        Description copied from interface: AppendingState
        Returns the current value for the state. When the state is not partitioned the returned value is the same for all inputs in a given operator instance. If state partitioning is applied, the value returned depends on the current operator input, as the operator maintains an independent state for each partition.

        NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null.

        Specified by:
        get in interface AppendingState<K,​N,​IN>
        Returns:
        The operator state value corresponding to the current input or null if the state is empty.
      • add

        public void add​(IN value)
        Description copied from interface: AppendingState
        Updates the operator state accessible by AppendingState.get() by adding the given value to the list of values. The next time AppendingState.get() is called (for the same state partition) the returned state will represent the updated list.

        If null is passed in, the behaviour is undefined (implementation related).

        Specified by:
        add in interface AppendingState<K,​N,​IN>
        Parameters:
        value - The new value for the state.
      • asyncMergeNamespaces

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