Class ImmutableMapState<K,V>
- java.lang.Object
-
- org.apache.flink.queryablestate.client.state.ImmutableMapState<K,V>
-
public final class ImmutableMapState<K,V> extends Object implements MapState<K,V>
A read-onlyMapState
that does not allow for modifications.This is the result returned when querying Flink's keyed state using the
Queryable State Client
and providing anMapStateDescriptor
.
-
-
Field Summary
Fields Modifier and Type Field Description protected static UnsupportedOperationException
MODIFICATION_ATTEMPT_ERROR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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>
ScreateState(StateDescriptor<S,T> stateDescriptor, byte[] serializedState)
Iterable<Map.Entry<K,V>>
entries()
Returns all the mappings in the state in aCollections.unmodifiableSet(Set)
.V
get(K key)
Returns the current value associated with the given key.boolean
isEmpty()
Returns true if this state contains no key-value mappings, otherwise false.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 aCollections.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 aCollections.unmodifiableCollection(Collection)
.
-
-
-
Field Detail
-
MODIFICATION_ATTEMPT_ERROR
protected static final UnsupportedOperationException MODIFICATION_ATTEMPT_ERROR
-
-
Method Detail
-
get
public V get(K key)
Description copied from interface:MapState
Returns the current value associated with the given key.
-
put
public void put(K key, V value)
Description copied from interface:MapState
Associates a new value with the given key.
-
putAll
public void putAll(Map<K,V> map)
Description copied from interface:MapState
Copies all of the mappings from the given map into the state.
-
remove
public void remove(K key)
Description copied from interface:MapState
Deletes the mapping of the given key.
-
contains
public boolean contains(K key)
Description copied from interface:MapState
Returns whether there exists the given mapping.
-
entries
public Iterable<Map.Entry<K,V>> entries()
Returns all the mappings in the state in aCollections.unmodifiableSet(Set)
.
-
keys
public Iterable<K> keys()
Returns all the keys in the state in aCollections.unmodifiableSet(Set)
.
-
values
public Iterable<V> values()
Returns all the values in the state in aCollections.unmodifiableCollection(Collection)
.
-
iterator
public Iterator<Map.Entry<K,V>> iterator()
Iterates over all the mappings in the state. The iterator cannot remove elements.
-
isEmpty
public boolean isEmpty()
Description copied from interface:MapState
Returns true if this state contains no key-value mappings, otherwise false.
-
clear
public void clear()
Description copied from interface:State
Removes the value mapped under the current key.
-
createState
public static <K,V,T,S extends State> S createState(StateDescriptor<S,T> stateDescriptor, byte[] serializedState) throws IOException
- Throws:
IOException
-
-