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.@Deprecated public class RocksDBFoldingState<K,N,T,ACC> extends AbstractRocksDBState<K,N,ACC,FoldingState<T,ACC>> implements InternalFoldingState<K,N,T,ACC>
FoldingState
implementation that stores state in RocksDB.backend, columnFamily, defaultValue, keySerializationDataOutputView, keySerializationStream, writeOptions
Constructor and Description |
---|
RocksDBFoldingState(org.rocksdb.ColumnFamilyHandle columnFamily,
TypeSerializer<N> namespaceSerializer,
TypeSerializer<ACC> valueSerializer,
ACC defaultValue,
FoldFunction<T,ACC> foldFunction,
RocksDBKeyedStateBackend<K> backend)
Deprecated.
Creates a new
RocksDBFoldingState . |
Modifier and Type | Method and Description |
---|---|
void |
add(T value)
Deprecated.
Updates the operator state accessible by
AppendingState.get() by adding the given value
to the list of values. |
ACC |
get()
Deprecated.
Returns the current value for the state.
|
TypeSerializer<K> |
getKeySerializer()
Deprecated.
Returns the
TypeSerializer for the type of key this state is associated to. |
TypeSerializer<N> |
getNamespaceSerializer()
Deprecated.
Returns the
TypeSerializer for the type of namespace this state is associated to. |
TypeSerializer<ACC> |
getValueSerializer()
Deprecated.
Returns the
TypeSerializer for the type of value this state holds. |
clear, getDefaultValue, getSerializedValue, setCurrentNamespace, writeCurrentKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSerializedValue, setCurrentNamespace
public RocksDBFoldingState(org.rocksdb.ColumnFamilyHandle columnFamily, TypeSerializer<N> namespaceSerializer, TypeSerializer<ACC> valueSerializer, ACC defaultValue, FoldFunction<T,ACC> foldFunction, RocksDBKeyedStateBackend<K> backend)
RocksDBFoldingState
.columnFamily
- The RocksDB column family that this state is associated to.namespaceSerializer
- The serializer for the namespace.valueSerializer
- The serializer for the state.defaultValue
- The default value for the state.foldFunction
- The fold function used for folding state.backend
- The backend for which this state is bind to.public TypeSerializer<K> getKeySerializer()
InternalKvState
TypeSerializer
for the type of key this state is associated to.getKeySerializer
in interface InternalKvState<K,N,ACC>
public TypeSerializer<N> getNamespaceSerializer()
InternalKvState
TypeSerializer
for the type of namespace this state is associated to.getNamespaceSerializer
in interface InternalKvState<K,N,ACC>
public TypeSerializer<ACC> getValueSerializer()
InternalKvState
TypeSerializer
for the type of value this state holds.getValueSerializer
in interface InternalKvState<K,N,ACC>
public ACC get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method
should return null
.
get
in interface AppendingState<T,ACC>
null
if the state is empty.public void add(T 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.
If null is passed in, the state value will remain unchanged.
add
in interface AppendingState<T,ACC>
value
- The new value for the state.IOException
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.