Class AbstractReducingState<K,​N,​V>

    • Method Detail

      • asyncGet

        public StateFuture<V> 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,​V>
        Returns:
        The operator state value corresponding to the current input or null wrapped by a StateFuture if the state is empty.
      • asyncAdd

        public StateFuture<Void> asyncAdd​(V value)
        Description copied from interface: AppendingState
        Updates the operator state accessible by AppendingState.asyncGet() by adding the given value to the list of values asynchronously. The next time AppendingState.asyncGet() is called (for the same state partition) the returned state will represent the updated list.

        null value is not allowed to be passed in.

        Specified by:
        asyncAdd in interface AppendingState<K,​N,​V>
        Parameters:
        value - The new value for the state.
      • get

        public V 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,​V>
        Returns:
        The operator state value corresponding to the current input or null if the state is empty.
      • add

        public void add​(V 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,​V>
        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,​V,​V,​V,​V>
        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,​V,​V,​V,​V>
        Parameters:
        target - The target namespace where the merged state should be stored.
        sources - The source namespaces whose state should be merged.