K
- The type of the key.N
- The type of the namespace.T
- The type of the values that can be folded into the state.ACC
- The type of the value in the folding state.public class RocksDBFoldingState<K,N,T,ACC> extends AbstractRocksDBState<K,N,FoldingState<T,ACC>,FoldingStateDescriptor<T,ACC>> implements FoldingState<T,ACC>
FoldingState
implementation that stores state in RocksDB.AbstractRocksDBState.AbstractRocksDBSnapshot<K,N,S extends State,SD extends StateDescriptor<S,?>>
Modifier and Type | Field and Description |
---|---|
protected FoldingStateDescriptor<T,ACC> |
stateDesc
This holds the name of the state and can create an initial default value for the state.
|
protected org.rocksdb.WriteOptions |
writeOptions
We disable writes to the write-ahead-log here.
|
basePath, checkpointPath, currentKey, currentNamespace, db, keySerializer, namespaceSerializer, rocksDbPath
Modifier | Constructor and Description |
---|---|
protected |
RocksDBFoldingState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
FoldingStateDescriptor<T,ACC> stateDesc,
File dbPath,
String backupPath,
org.rocksdb.Options options)
Creates a new
RocksDBFoldingState . |
protected |
RocksDBFoldingState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
FoldingStateDescriptor<T,ACC> stateDesc,
File dbPath,
String backupPath,
String restorePath,
org.rocksdb.Options options)
Creates a
RocksDBFoldingState by restoring from a directory. |
Modifier and Type | Method and Description |
---|---|
void |
add(T value)
Updates the operator state accessible by
MergingState.get() by adding the given value
to the list of values. |
protected AbstractRocksDBState.AbstractRocksDBSnapshot<K,N,FoldingState<T,ACC>,FoldingStateDescriptor<T,ACC>> |
createRocksDBSnapshot(URI backupUri,
long checkpointId) |
ACC |
get()
Returns the current value for the state.
|
clear, dispose, setCurrentKey, setCurrentNamespace, snapshot, writeKeyAndNamespace
protected final FoldingStateDescriptor<T,ACC> stateDesc
protected final org.rocksdb.WriteOptions writeOptions
protected RocksDBFoldingState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, FoldingStateDescriptor<T,ACC> stateDesc, File dbPath, String backupPath, org.rocksdb.Options options)
RocksDBFoldingState
.keySerializer
- The serializer for the keys.namespaceSerializer
- The serializer for the namespace.stateDesc
- The state identifier for the state. This contains name
and can create a default state value.dbPath
- The path on the local system where RocksDB data should be stored.backupPath
- The path where to store backups.protected RocksDBFoldingState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, FoldingStateDescriptor<T,ACC> stateDesc, File dbPath, String backupPath, String restorePath, org.rocksdb.Options options)
RocksDBFoldingState
by restoring from a directory.keySerializer
- The serializer for the keys.namespaceSerializer
- The serializer for the namespace.stateDesc
- The state identifier for the state. This contains name
and can create a default state value.dbPath
- The path on the local system where RocksDB data should be stored.backupPath
- The path where to store backups.restorePath
- The path on the local file system that we are restoring from.public ACC get()
MergingState
get
in interface MergingState<T,ACC>
public void add(T value) throws IOException
MergingState
MergingState.get()
by adding the given value
to the list of values. The next time MergingState.get()
is called (for the same state
partition) the returned state will represent the updated list.add
in interface MergingState<T,ACC>
value
- The new value for the state.IOException
- Thrown if the system cannot access the state.protected AbstractRocksDBState.AbstractRocksDBSnapshot<K,N,FoldingState<T,ACC>,FoldingStateDescriptor<T,ACC>> createRocksDBSnapshot(URI backupUri, long checkpointId)
createRocksDBSnapshot
in class AbstractRocksDBState<K,N,FoldingState<T,ACC>,FoldingStateDescriptor<T,ACC>>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.