K
- The type of the key.N
- The type of the namespace.V
- The type of value that the state state stores.public class RocksDBReducingState<K,N,V> extends AbstractRocksDBState<K,N,ReducingState<V>,ReducingStateDescriptor<V>> implements ReducingState<V>
ReducingState
implementation that stores state in RocksDB.backend, columnFamily
Constructor and Description |
---|
RocksDBReducingState(org.rocksdb.ColumnFamilyHandle columnFamily,
TypeSerializer<N> namespaceSerializer,
ReducingStateDescriptor<V> stateDesc,
RocksDBStateBackend backend)
Creates a new
RocksDBReducingState . |
Modifier and Type | Method and Description |
---|---|
void |
add(V value)
Updates the operator state accessible by
AppendingState.get() by adding the given value
to the list of values. |
V |
get()
Returns the current value for the state.
|
clear, dispose, setCurrentKey, setCurrentNamespace, snapshot, writeKeyAndNamespace
public RocksDBReducingState(org.rocksdb.ColumnFamilyHandle columnFamily, TypeSerializer<N> namespaceSerializer, ReducingStateDescriptor<V> stateDesc, RocksDBStateBackend backend)
RocksDBReducingState
.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 get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method
should return null
.
get
in interface AppendingState<V,V>
null
if the state is empty.public void add(V value) throws IOException
AppendingState
AppendingState.get()
by adding the given value
to the list of values. The next time AppendingState.get()
is called (for the same state
partition) the returned state will represent the updated list.add
in interface AppendingState<V,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.