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,List<V>,org.apache.flink.api.common.state.ListState<V>> implements org.apache.flink.runtime.state.internal.InternalListState<K,N,V>
ListState implementation that stores state in RocksDB.
RocksDBStateBackend must ensure that we set the
StringAppendOperator on the column family that we use for our state since
we use the merge() call.
backend, columnFamily, defaultValue, keySerializationDataOutputView, keySerializationStream, writeOptions| Constructor and Description |
|---|
RocksDBListState(org.rocksdb.ColumnFamilyHandle columnFamily,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<List<V>> valueSerializer,
List<V> defaultValue,
org.apache.flink.api.common.typeutils.TypeSerializer<V> elementSerializer,
RocksDBKeyedStateBackend<K> backend)
Creates a new
RocksDBListState. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(V value) |
void |
addAll(List<V> values) |
Iterable<V> |
get() |
org.apache.flink.api.common.typeutils.TypeSerializer<K> |
getKeySerializer() |
org.apache.flink.api.common.typeutils.TypeSerializer<N> |
getNamespaceSerializer() |
org.apache.flink.api.common.typeutils.TypeSerializer<List<V>> |
getValueSerializer() |
void |
mergeNamespaces(N target,
Collection<N> sources) |
void |
update(List<V> values) |
clear, getDefaultValue, getSerializedValue, setCurrentNamespace, writeCurrentKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic RocksDBListState(org.rocksdb.ColumnFamilyHandle columnFamily,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<List<V>> valueSerializer,
List<V> defaultValue,
org.apache.flink.api.common.typeutils.TypeSerializer<V> elementSerializer,
RocksDBKeyedStateBackend<K> backend)
RocksDBListState.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.elementSerializer - The serializer for elements of the list state.backend - The backend for which this state is bind to.public org.apache.flink.api.common.typeutils.TypeSerializer<K> getKeySerializer()
public org.apache.flink.api.common.typeutils.TypeSerializer<N> getNamespaceSerializer()
public org.apache.flink.api.common.typeutils.TypeSerializer<List<V>> getValueSerializer()
public void add(V value) throws IOException
add in interface org.apache.flink.api.common.state.AppendingState<V,Iterable<V>>IOExceptionpublic void mergeNamespaces(N target, Collection<N> sources) throws Exception
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.