K
- The type of the key.N
- The type of the namespace.UK
- The type of the keys in the state.UV
- The type of the values in the state.public class HeapMapState<K,N,UK,UV> extends AbstractHeapState<K,N,HashMap<UK,UV>,org.apache.flink.api.common.state.MapState<UK,UV>,org.apache.flink.api.common.state.MapStateDescriptor<UK,UV>> implements InternalMapState<N,UK,UV>
MapState
that is snapshotted into files.currentNamespace, keySerializer, namespaceSerializer, stateDesc, stateTable
Constructor and Description |
---|
HeapMapState(org.apache.flink.api.common.state.MapStateDescriptor<UK,UV> stateDesc,
StateTable<K,N,HashMap<UK,UV>> stateTable,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer)
Creates a new key/value state for the given hash map of key/value pairs.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(UK userKey) |
Iterable<Map.Entry<UK,UV>> |
entries() |
UV |
get(UK userKey) |
byte[] |
getSerializedValue(K key,
N namespace) |
Iterator<Map.Entry<UK,UV>> |
iterator() |
Iterable<UK> |
keys() |
void |
put(UK userKey,
UV userValue) |
void |
putAll(Map<UK,UV> value) |
void |
remove(UK userKey) |
Iterable<UV> |
values() |
clear, getSerializedValue, getStateTable, setCurrentNamespace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSerializedValue, setCurrentNamespace
public HeapMapState(org.apache.flink.api.common.state.MapStateDescriptor<UK,UV> stateDesc, StateTable<K,N,HashMap<UK,UV>> stateTable, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer)
stateDesc
- The state identifier for the state. This contains name
and can create a default state value.stateTable
- The state tab;e to use in this kev/value state. May contain initial state.public void remove(UK userKey)
public boolean contains(UK userKey)
public byte[] getSerializedValue(K key, N namespace) throws IOException
getSerializedValue
in class AbstractHeapState<K,N,HashMap<UK,UV>,org.apache.flink.api.common.state.MapState<UK,UV>,org.apache.flink.api.common.state.MapStateDescriptor<UK,UV>>
IOException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.