K
- The type of the key.N
- The type of the namespace.V
- The type of the value.public class FsReducingState<K,N,V> extends AbstractFsState<K,N,V,org.apache.flink.api.common.state.ReducingState<V>,org.apache.flink.api.common.state.ReducingStateDescriptor<V>> implements org.apache.flink.api.common.state.ReducingState<V>
ReducingState
that is
snapshotted into files.Modifier and Type | Class and Description |
---|---|
static class |
FsReducingState.Snapshot<K,N,V> |
currentKey, currentNamespace, currentNSState, keySerializer, namespaceSerializer, state, stateDesc, stateSerializer
Constructor and Description |
---|
FsReducingState(FsStateBackend backend,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.ReducingStateDescriptor<V> stateDesc)
Creates a new and empty partitioned state.
|
FsReducingState(FsStateBackend backend,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.ReducingStateDescriptor<V> stateDesc,
HashMap<N,Map<K,V>> state)
Creates a new key/value state with the given state contents.
|
Modifier and Type | Method and Description |
---|---|
void |
add(V value) |
KvStateSnapshot<K,N,org.apache.flink.api.common.state.ReducingState<V>,org.apache.flink.api.common.state.ReducingStateDescriptor<V>,FsStateBackend> |
createHeapSnapshot(org.apache.flink.core.fs.Path filePath) |
V |
get() |
snapshot
clear, dispose, getKeySerializer, getNamespaceSerializer, setCurrentKey, setCurrentNamespace, size
public FsReducingState(FsStateBackend backend, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, org.apache.flink.api.common.state.ReducingStateDescriptor<V> stateDesc)
backend
- The file system state backend backing snapshots of this statekeySerializer
- The serializer for the key.namespaceSerializer
- The serializer for the namespace.stateDesc
- The state identifier for the state. This contains name
and can create a default state value.public FsReducingState(FsStateBackend backend, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, org.apache.flink.api.common.state.ReducingStateDescriptor<V> stateDesc, HashMap<N,Map<K,V>> state)
backend
- The file system state backend backing snapshots of this statekeySerializer
- The serializer for the key.namespaceSerializer
- The serializer for the namespace.stateDesc
- The state identifier for the state. This contains name
and can create a default state value.state
- The map of key/value pairs to initialize the state with.public V get()
public void add(V value) throws IOException
add
in interface org.apache.flink.api.common.state.MergingState<V,V>
IOException
public KvStateSnapshot<K,N,org.apache.flink.api.common.state.ReducingState<V>,org.apache.flink.api.common.state.ReducingStateDescriptor<V>,FsStateBackend> createHeapSnapshot(org.apache.flink.core.fs.Path filePath)
createHeapSnapshot
in class AbstractFsState<K,N,V,org.apache.flink.api.common.state.ReducingState<V>,org.apache.flink.api.common.state.ReducingStateDescriptor<V>>
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.