K - The type of the keyN - The type of the namespaceS - The type of the StateSD - The type of the StateDescriptorBackend - The type of the backend that can restore the state from this snapshot.public interface KvStateSnapshot<K,N,S extends org.apache.flink.api.common.state.State,SD extends org.apache.flink.api.common.state.StateDescriptor<S,?>,Backend extends AbstractStateBackend> extends StateObject
KvState, taken for a checkpoint. Where exactly
the snapshot stores the snapshot data (in this object, in an external data store, etc) depends
on the actual implementation. This snapshot defines merely how to restore the state and
how to discard the state.
One possible implementation is that this snapshot simply contains a copy of the key/value map.
Another possible implementation for this snapshot is that the key/value map is serialized into a file and this snapshot object contains a pointer to that file.
| Modifier and Type | Method and Description |
|---|---|
KvState<K,N,S,SD,Backend> |
restoreState(Backend stateBackend,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
ClassLoader classLoader)
Loads the key/value state back from this snapshot.
|
discardState, getStateSizeKvState<K,N,S,SD,Backend> restoreState(Backend stateBackend, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, ClassLoader classLoader) throws Exception
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.Exception - Exceptions can occur during the state loading and are forwarded.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.