Interface EntryStore<K,V>

Type Parameters:
K - key type
V - value type
All Superinterfaces:
EntryLoader<K,V>, MapStore<K,V>

public interface EntryStore<K,V> extends MapStore<K,V>, EntryLoader<K,V>
Metadata-aware MapStore extension for values that carry per-entry expiry.

Implementations can persist MetadataAwareValue.expiryEpochMillis() alongside the value. The inherited value-only MapStore methods are bridged to never-expiring values for backward compatibility.

  • Method Details

    • storeEntry

      void storeEntry(K key, MetadataAwareValue<V> value)
    • storeAllEntries

      default void storeAllEntries(Map<? extends K, MetadataAwareValue<V>> entries)
    • load

      default @Nullable V load(K key)
      Description copied from interface: MapStore
      Load the value associated with key from the backing store.
      Specified by:
      load in interface MapStore<K,V>
      Parameters:
      key - the key to look up (never null)
      Returns:
      the associated value, or null when no value exists
    • loadAll

      default Map<K,V> loadAll(Collection<? extends K> keys)
      Description copied from interface: MapStore
      Load multiple values in one round-trip. Default implementation loops MapStore.load(Object); override for efficiency when the store supports bulk reads.
      Specified by:
      loadAll in interface MapStore<K,V>
      Parameters:
      keys - keys to load (never null; may contain no duplicates)
      Returns:
      a map containing only keys for which a non-null value was loaded
    • store

      default void store(K key, V value)
      Description copied from interface: MapStore
      Persist a single key/value pair.
      Specified by:
      store in interface MapStore<K,V>
      Parameters:
      key - the key (never null)
      value - the value to persist (never null)
    • storeAll

      default void storeAll(Map<? extends K, ? extends V> entries)
      Description copied from interface: MapStore
      Persist multiple key/value pairs. Default implementation loops MapStore.store(Object, Object); override for efficiency when the store supports bulk writes.
      Specified by:
      storeAll in interface MapStore<K,V>
      Parameters:
      entries - entries to persist (never null)