Interface KeyValueStore<K,V>

Type Parameters:
K - key type
V - value type

public interface KeyValueStore<K,V>
Key value store implemented by in-memory cache backed with data from a potentially partitioned source like a Kafka topic. Status must be tracked separately for each partition by the implementation of this store.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fail(int partition, String errorMessage)
    Sets local error for the store with the specified error message.
    get(K key)
    Returns the current value associated with key if it exists or null otherwise.
    Map<? extends K,? extends V>
    map(String entryType)
     
    put(K key, V value)
    Updates the entry for key with the specified value.
    remove(K key)
    Removes the entry corresponding to the key if it is present in the store.
    status(int partition)
    Status of the metadata store for the specified partition
  • Method Details

    • get

      V get(K key)
      Returns the current value associated with key if it exists or null otherwise.
    • put

      V put(K key, V value)
      Updates the entry for key with the specified value. Value must not be null. Data records as well as remote status and error records are processed using this method.
      Returns:
      old value if key was present in the store, null otherwise
    • remove

      V remove(K key)
      Removes the entry corresponding to the key if it is present in the store.
      Returns:
      old value if key was present in the store, null otherwise
    • map

      Map<? extends K,? extends V> map(String entryType)
    • fail

      void fail(int partition, String errorMessage)
      Sets local error for the store with the specified error message. This is invoked if the reader encountered a fatal error.
    • status

      MetadataStoreStatus status(int partition)
      Status of the metadata store for the specified partition