K
- The type of the keyN
- The type of the namespaceS
- The type of the State
SD
- The type of the StateDescriptor
Backend
- The type of the backend that can restore the state from this snapshot.public abstract class AsynchronousKvStateSnapshot<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 Object implements KvStateSnapshot<K,N,S,SD,Backend>
KvStateSnapshot
that asynchronously materializes the state that it represents. Instead
of representing a materialized handle to state this would normally hold the (immutable) state
internally and materializes it when materialize()
is called.Constructor and Description |
---|
AsynchronousKvStateSnapshot() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
discardState()
Discards the state referred to by this handle, to free up resources in
the persistent storage.
|
long |
getStateSize()
Returns the size of the state in bytes.
|
abstract KvStateSnapshot<K,N,S,SD,Backend> |
materialize()
Materializes the state held by this
AsynchronousKvStateSnapshot . |
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.
|
public abstract KvStateSnapshot<K,N,S,SD,Backend> materialize() throws Exception
AsynchronousKvStateSnapshot
.Exception
public final KvState<K,N,S,SD,Backend> restoreState(Backend stateBackend, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, ClassLoader classLoader) throws Exception
KvStateSnapshot
restoreState
in 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>
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.public void discardState() throws Exception
StateObject
discardState
in interface StateObject
Exception
public long getStateSize() throws Exception
StateObject
If the the size is not known, return 0
.
getStateSize
in interface StateObject
Exception
- If the operation fails during size retrieval.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.