Class StateMapSnapshot<K,​N,​S,​T extends StateMap<K,​N,​S>>

  • Type Parameters:
    K - type of key
    N - type of namespace
    S - type of state
    Direct Known Subclasses:
    CopyOnWriteStateMapSnapshot

    public abstract class StateMapSnapshot<K,​N,​S,​T extends StateMap<K,​N,​S>>
    extends Object
    Base class for snapshots of a StateMap.
    • Field Detail

      • owningStateMap

        protected final T extends StateMap<K,​N,​S> owningStateMap
        The StateMap from which this snapshot was created.
    • Constructor Detail

      • StateMapSnapshot

        public StateMapSnapshot​(T stateMap)
    • Method Detail

      • isOwner

        public boolean isOwner​(T stateMap)
        Returns true iff the given state map is the owner of this snapshot object.
      • release

        public void release()
        Release the snapshot.
      • getIterator

        public abstract Iterator<StateEntry<K,​N,​S>> getIterator​(@Nonnull
                                                                            org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
                                                                            @Nonnull
                                                                            org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
                                                                            @Nonnull
                                                                            org.apache.flink.api.common.typeutils.TypeSerializer<S> stateSerializer,
                                                                            @Nullable
                                                                            StateSnapshotTransformer<S> stateSnapshotTransformer)
      • writeState

        public abstract void writeState​(org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
                                        org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
                                        org.apache.flink.api.common.typeutils.TypeSerializer<S> stateSerializer,
                                        @Nonnull
                                        org.apache.flink.core.memory.DataOutputView dov,
                                        @Nullable
                                        StateSnapshotTransformer<S> stateSnapshotTransformer)
                                 throws IOException
        Writes the state in this snapshot to output. The state need to be transformed with the given transformer if the transformer is non-null.
        Parameters:
        keySerializer - the key serializer.
        namespaceSerializer - the namespace serializer.
        stateSerializer - the state serializer.
        dov - the output.
        stateSnapshotTransformer - state transformer, and can be null.
        Throws:
        IOException - on write-related problems.