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>,V> implements InternalValueState<N,V>
ValueState
implementation that stores state in RocksDB.backend, columnFamily, keySerializationDataOutputView, keySerializationStream, stateDesc
Constructor and Description |
---|
RocksDBValueState(org.rocksdb.ColumnFamilyHandle columnFamily,
TypeSerializer<N> namespaceSerializer,
ValueStateDescriptor<V> stateDesc,
RocksDBKeyedStateBackend<K> 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, getSerializedValue, readKeyWithGroupAndNamespace, setCurrentNamespace, writeCurrentKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSerializedValue, setCurrentNamespace
public RocksDBValueState(org.rocksdb.ColumnFamilyHandle columnFamily, TypeSerializer<N> namespaceSerializer, ValueStateDescriptor<V> stateDesc, RocksDBKeyedStateBackend<K> 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
If you didn't specify a default value when creating the ValueStateDescriptor
this will return null
when to value was previously set using ValueState.update(Object)
.
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 ValueState<V>
value
- The new value for the state.IOException
- Thrown if the system cannot access the state.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.