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

java.lang.Object
org.apache.flink.runtime.state.heap.StateMapSnapshot<K,N,S,T>
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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final T
    The StateMap from which this snapshot was created.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StateMapSnapshot(T stateMap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Iterator<StateEntry<K,N,S>>
    getIterator(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, StateSnapshotTransformer<S> stateSnapshotTransformer)
     
    boolean
    isOwner(T stateMap)
    Returns true iff the given state map is the owner of this snapshot object.
    void
    Release the snapshot.
    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, org.apache.flink.core.memory.DataOutputView dov, StateSnapshotTransformer<S> stateSnapshotTransformer)
    Writes the state in this snapshot to output.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • owningStateMap

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

    • StateMapSnapshot

      public StateMapSnapshot(T stateMap)
  • Method Details

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