Interface KeyValueStore<K,V>

Type Parameters:
K - The key type
V - The value type
All Superinterfaces:
ReadOnlyKeyValueStore<K,V>, StateStore
All Known Subinterfaces:
TimestampedKeyValueStore<K,V>

public interface KeyValueStore<K,V> extends StateStore, ReadOnlyKeyValueStore<K,V>
A key-value store that supports put/get/delete and range queries.
  • Method Details

    • put

      void put(K key, V value)
      Update the value associated with this key.
      Parameters:
      key - The key to associate the value to
      value - The value to update, it can be null; if the serialized bytes are also null it is interpreted as deletes
      Throws:
      NullPointerException - If null is used for key.
    • putIfAbsent

      V putIfAbsent(K key, V value)
      Update the value associated with this key, unless a value is already associated with the key.
      Parameters:
      key - The key to associate the value to
      value - The value to update, it can be null; if the serialized bytes are also null it is interpreted as deletes
      Returns:
      The old value or null if there is no such key.
      Throws:
      NullPointerException - If null is used for key.
    • putAll

      void putAll(List<KeyValue<K,V>> entries)
      Update all the given key/value pairs.
      Parameters:
      entries - A list of entries to put into the store; if the serialized bytes are also null it is interpreted as deletes
      Throws:
      NullPointerException - If null is used for key.
    • delete

      V delete(K key)
      Delete the value from the store (if there is one).
      Parameters:
      key - The key
      Returns:
      The old value or null if there is no such key.
      Throws:
      NullPointerException - If null is used for key.