Class ImmutableMapState<K,V>

java.lang.Object
org.apache.flink.queryablestate.client.state.ImmutableMapState<K,V>
All Implemented Interfaces:
org.apache.flink.api.common.state.MapState<K,V>, org.apache.flink.api.common.state.State

public final class ImmutableMapState<K,V> extends Object implements org.apache.flink.api.common.state.MapState<K,V>
A read-only 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.

  • Field Details

  • Method Details

    • get

      public V get(K key)
      Specified by:
      get in interface org.apache.flink.api.common.state.MapState<K,V>
    • put

      public void put(K key, V value)
      Specified by:
      put in interface org.apache.flink.api.common.state.MapState<K,V>
    • putAll

      public void putAll(Map<K,V> map)
      Specified by:
      putAll in interface org.apache.flink.api.common.state.MapState<K,V>
    • remove

      public void remove(K key)
      Specified by:
      remove in interface org.apache.flink.api.common.state.MapState<K,V>
    • contains

      public boolean contains(K key)
      Specified by:
      contains in interface org.apache.flink.api.common.state.MapState<K,V>
    • entries

      public Iterable<Map.Entry<K,V>> entries()
      Returns all the mappings in the state in a Collections.unmodifiableSet(Set).
      Specified by:
      entries in interface org.apache.flink.api.common.state.MapState<K,V>
      Returns:
      A read-only iterable view of all the key-value pairs in the state.
    • keys

      public Iterable<K> keys()
      Returns all the keys in the state in a Collections.unmodifiableSet(Set).
      Specified by:
      keys in interface org.apache.flink.api.common.state.MapState<K,V>
      Returns:
      A read-only iterable view of all the keys in the state.
    • values

      public Iterable<V> values()
      Returns all the values in the state in a Collections.unmodifiableCollection(Collection).
      Specified by:
      values in interface org.apache.flink.api.common.state.MapState<K,V>
      Returns:
      A read-only iterable view of all the values in the state.
    • iterator

      public Iterator<Map.Entry<K,V>> iterator()
      Iterates over all the mappings in the state. The iterator cannot remove elements.
      Specified by:
      iterator in interface org.apache.flink.api.common.state.MapState<K,V>
      Returns:
      A read-only iterator over all the mappings in the state.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.apache.flink.api.common.state.MapState<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface org.apache.flink.api.common.state.State
    • createState

      public static <K, V, T, S extends org.apache.flink.api.common.state.State> S createState(org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor, byte[] serializedState) throws IOException
      Throws:
      IOException