K
- The type of the key.N
- The type of the namespace.V
- The type of value that the state state stores.public class RocksDBValueState<K,N,V> extends AbstractRocksDBState<K,N,ValueState<V>,ValueStateDescriptor<V>> implements ValueState<V>
ValueState
implementation that stores state in RocksDB.backend, columnFamily
Constructor and Description |
---|
RocksDBValueState(org.rocksdb.ColumnFamilyHandle columnFamily,
TypeSerializer<N> namespaceSerializer,
ValueStateDescriptor<V> stateDesc,
RocksDBStateBackend backend)
Creates a new
RocksDBValueState . |
Modifier and Type | Method and Description |
---|---|
void |
update(V value)
Updates the operator state accessible by
ValueState.value() to the given
value. |
V |
value()
Returns the current value for the state.
|
clear, dispose, setCurrentKey, setCurrentNamespace, snapshot, writeKeyAndNamespace
public RocksDBValueState(org.rocksdb.ColumnFamilyHandle columnFamily, TypeSerializer<N> namespaceSerializer, ValueStateDescriptor<V> stateDesc, RocksDBStateBackend backend)
RocksDBValueState
.namespaceSerializer
- The serializer for the namespace.stateDesc
- The state identifier for the state. This contains name
and can create a default state value.public V value()
ValueState
value
in interface OperatorState<V>
value
in interface ValueState<V>
public void update(V value) throws IOException
ValueState
ValueState.value()
to the given
value. The next time ValueState.value()
is called (for the same state
partition) the returned state will represent the updated value. When a
partitioned state is updated with null, the state for the current key
will be removed and the default value is returned on the next access.update
in interface OperatorState<V>
update
in interface ValueState<V>
value
- The new value for the state.IOException
- Thrown if the system cannot access the state.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.