K
- The type of the key.N
- The type of the namespace.V
- The type of the values in the list state.public class RocksDBListState<K,N,V> extends AbstractRocksDBState<K,N,ListState<V>,ListStateDescriptor<V>> implements ListState<V>
ListState
implementation that stores state in RocksDB.AbstractRocksDBState.AbstractRocksDBSnapshot<K,N,S extends State,SD extends StateDescriptor<S,?>>
Modifier and Type | Field and Description |
---|---|
protected ListStateDescriptor<V> |
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 |
RocksDBListState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
ListStateDescriptor<V> stateDesc,
File dbPath,
String backupPath,
org.rocksdb.Options options)
Creates a new
RocksDBListState . |
protected |
RocksDBListState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
ListStateDescriptor<V> stateDesc,
File dbPath,
String backupPath,
String restorePath,
org.rocksdb.Options options)
Creates a
RocksDBListState by restoring from a directory. |
Modifier and Type | Method and Description |
---|---|
void |
add(V value)
Updates the operator state accessible by
MergingState.get() by adding the given value
to the list of values. |
protected AbstractRocksDBState.AbstractRocksDBSnapshot<K,N,ListState<V>,ListStateDescriptor<V>> |
createRocksDBSnapshot(URI backupUri,
long checkpointId) |
Iterable<V> |
get()
Returns the current value for the state.
|
clear, dispose, setCurrentKey, setCurrentNamespace, snapshot, writeKeyAndNamespace
protected final ListStateDescriptor<V> stateDesc
protected final org.rocksdb.WriteOptions writeOptions
protected RocksDBListState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, ListStateDescriptor<V> stateDesc, File dbPath, String backupPath, org.rocksdb.Options options)
RocksDBListState
.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 RocksDBListState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, ListStateDescriptor<V> stateDesc, File dbPath, String backupPath, String restorePath, org.rocksdb.Options options)
RocksDBListState
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 Iterable<V> get()
MergingState
get
in interface MergingState<V,Iterable<V>>
public void add(V 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<V,Iterable<V>>
value
- The new value for the state.IOException
- Thrown if the system cannot access the state.protected AbstractRocksDBState.AbstractRocksDBSnapshot<K,N,ListState<V>,ListStateDescriptor<V>> createRocksDBSnapshot(URI backupUri, long checkpointId)
createRocksDBSnapshot
in class AbstractRocksDBState<K,N,ListState<V>,ListStateDescriptor<V>>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.