K - The type of the key in the snapshot state.N - The type of the namespace in the snapshot state.SV - The type of the state value.public abstract class AbstractFsStateSnapshot<K,N,SV,S extends org.apache.flink.api.common.state.State,SD extends org.apache.flink.api.common.state.StateDescriptor<S,?>> extends AbstractFileStateHandle implements KvStateSnapshot<K,N,S,SD,FsStateBackend>
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.api.common.typeutils.TypeSerializer<K> |
keySerializer
Key Serializer
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<N> |
namespaceSerializer
Namespace Serializer
|
protected SD |
stateDesc
StateDescriptor, for sanity checks
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<SV> |
stateSerializer
Serializer for the state value
|
| Constructor and Description |
|---|
AbstractFsStateSnapshot(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<SV> stateSerializer,
SD stateDesc,
org.apache.flink.core.fs.Path filePath)
Creates a new state snapshot with data in the file system.
|
| Modifier and Type | Method and Description |
|---|---|
abstract KvState<K,N,S,SD,FsStateBackend> |
createFsState(FsStateBackend backend,
HashMap<N,Map<K,SV>> stateMap) |
long |
getStateSize()
Returns the file size in bytes.
|
KvState<K,N,S,SD,FsStateBackend> |
restoreState(FsStateBackend stateBackend,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
ClassLoader classLoader,
long recoveryTimestamp)
Loads the key/value state back from this snapshot.
|
discardState, getFilePath, getFileSize, getFileSystemclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdiscardStateprotected final org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer
protected final org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer
protected final org.apache.flink.api.common.typeutils.TypeSerializer<SV> stateSerializer
public AbstractFsStateSnapshot(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<SV> stateSerializer, SD stateDesc, org.apache.flink.core.fs.Path filePath)
keySerializer - The serializer for the keys.namespaceSerializer - The serializer for the namespace.stateSerializer - The serializer for the elements in the state HashMapstateDesc - The state identifierfilePath - The path where the snapshot data is stored.public abstract KvState<K,N,S,SD,FsStateBackend> createFsState(FsStateBackend backend, HashMap<N,Map<K,SV>> stateMap)
public KvState<K,N,S,SD,FsStateBackend> restoreState(FsStateBackend stateBackend, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, ClassLoader classLoader, long recoveryTimestamp) throws Exception
KvStateSnapshotrestoreState in interface KvStateSnapshot<K,N,S extends org.apache.flink.api.common.state.State,SD extends org.apache.flink.api.common.state.StateDescriptor<S,?>,FsStateBackend>stateBackend - The state backend that created this snapshot and can restore the key/value state
from this snapshot.keySerializer - The serializer for the keys.classLoader - The class loader for user-defined types.recoveryTimestamp - The timestamp of the checkpoint we are recovering from.Exception - Exceptions can occur during the state loading and are forwarded.public long getStateSize()
throws IOException
getStateSize in interface KvStateSnapshot<K,N,S extends org.apache.flink.api.common.state.State,SD extends org.apache.flink.api.common.state.StateDescriptor<S,?>,FsStateBackend>IOException - Thrown if the file system cannot be accessed.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.