K - The type of the keyN - The type of the namespaceT - The type of the values that aggregated into the stateACC - The type of the value stored in the state (the accumulator type)R - The type of the value returned from the statepublic class RocksDBAggregatingState<K,N,T,ACC,R> extends AbstractRocksDBState<K,N,ACC,org.apache.flink.api.common.state.AggregatingState<T,R>> implements org.apache.flink.runtime.state.internal.InternalAggregatingState<K,N,T,ACC,R>
AggregatingState implementation that stores state in RocksDB.backend, columnFamily, defaultValue, keySerializationDataOutputView, keySerializationStream, writeOptions| Constructor and Description |
|---|
RocksDBAggregatingState(org.rocksdb.ColumnFamilyHandle columnFamily,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<ACC> valueSerializer,
ACC defaultValue,
org.apache.flink.api.common.functions.AggregateFunction<T,ACC,R> aggFunction,
RocksDBKeyedStateBackend<K> backend)
Creates a new
RocksDBAggregatingState. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T value) |
R |
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<ACC> |
getValueSerializer() |
void |
mergeNamespaces(N target,
Collection<N> sources) |
clear, getDefaultValue, getSerializedValue, setCurrentNamespace, writeCurrentKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespace, writeKeyWithGroupAndNamespaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic RocksDBAggregatingState(org.rocksdb.ColumnFamilyHandle columnFamily,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<ACC> valueSerializer,
ACC defaultValue,
org.apache.flink.api.common.functions.AggregateFunction<T,ACC,R> aggFunction,
RocksDBKeyedStateBackend<K> backend)
RocksDBAggregatingState.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.aggFunction - The aggregate function used for aggregating 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<ACC> getValueSerializer()
public R get() throws IOException
get in interface org.apache.flink.api.common.state.AppendingState<T,R>IOExceptionpublic void add(T value) throws IOException
add in interface org.apache.flink.api.common.state.AppendingState<T,R>IOExceptionCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.