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 keyN
- type of namespaceS
- 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 aStateMap
.
-
-
Field Summary
Fields Modifier and Type Field Description protected T
owningStateMap
TheStateMap
from which this snapshot was created.
-
Constructor Summary
Constructors Constructor Description StateMapSnapshot(T stateMap)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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()
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.
-
-
-
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.
-
-