pyflink.datastream.state.MapState#
- class MapState(*args, **kwds)[source]#
State
interface for partitioned key-value state. The key-value pair can be added, updated and retrieved. The state is accessed and modified by user functions, and checkpointed consistently by the system as part of the distributed snapshots.The state key is automatically supplied by the system, so the function always sees the value mapped to the key of the current element. That way, the system can handle stream and state partitioning consistently together.
Methods
clear
()Removes the value mapped under the current key.
contains
(key)Returns whether there exists the given mapping.
get
(key)Returns the current value associated with the given key.
is_empty
()Returns true if this state contains no key-value mappings, otherwise false.
items
()Returns all the mappings in the state.
keys
()Returns all the keys in the state.
put
(key, value)Associates a new value with the given key.
put_all
(dict_value)Copies all of the mappings from the given map into the state.
remove
(key)Deletes the mapping of the given key.
values
()Returns all the values in the state.