public final class ImmutableMapState<K,V> extends Object implements MapState<K,V>
MapState
that does not allow for modifications.
This is the result returned when querying Flink's keyed state using the
Queryable State Client
and
providing an MapStateDescriptor
.
Modifier and Type | Field and Description |
---|---|
protected static UnsupportedOperationException |
MODIFICATION_ATTEMPT_ERROR |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes the value mapped under the current key.
|
boolean |
contains(K key)
Returns whether there exists the given mapping.
|
static <K,V,T,S extends State> |
createState(StateDescriptor<S,T> stateDescriptor,
byte[] serializedState) |
Iterable<Map.Entry<K,V>> |
entries()
Returns all the mappings in the state in a
Collections.unmodifiableSet(Set) . |
V |
get(K key)
Returns the current value associated with the given key.
|
Iterator<Map.Entry<K,V>> |
iterator()
Iterates over all the mappings in the state.
|
Iterable<K> |
keys()
Returns all the keys in the state in a
Collections.unmodifiableSet(Set) . |
void |
put(K key,
V value)
Associates a new value with the given key.
|
void |
putAll(Map<K,V> map)
Copies all of the mappings from the given map into the state.
|
void |
remove(K key)
Deletes the mapping of the given key.
|
Iterable<V> |
values()
Returns all the values in the state in a
Collections.unmodifiableCollection(Collection) . |
protected static final UnsupportedOperationException MODIFICATION_ATTEMPT_ERROR
public V get(K key)
MapState
public void put(K key, V value)
MapState
public void putAll(Map<K,V> map)
MapState
public void remove(K key)
MapState
public boolean contains(K key)
MapState
public Iterable<Map.Entry<K,V>> entries()
Collections.unmodifiableSet(Set)
.public Iterable<K> keys()
Collections.unmodifiableSet(Set)
.public Iterable<V> values()
Collections.unmodifiableCollection(Collection)
.public Iterator<Map.Entry<K,V>> iterator()
public void clear()
State
public static <K,V,T,S extends State> S createState(StateDescriptor<S,T> stateDescriptor, byte[] serializedState) throws IOException
IOException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.