Type Parameters:
K - The key type
V - The value type
All Known Implementing Classes:
AsyncClaimingCacheImplGuava

public interface AsyncClaimingCache<K,V>
Interface for an async cache that allows "claiming" entries. Claiming means making explicit references to entries. As long as an entry is claimed it will not be evicted. Furthermore, eviction guards can be placed that prevent eviction even of non-claimed entries.
  • Method Details

    • claim

      RefFuture<V> claim(K key)
      Claim a reference to the key's entry.
    • claimIfPresent

      RefFuture<V> claimIfPresent(K key)
      Claim a key for which loading has already been triggered or which is already loaded. Calling this method should not trigger loading.
    • addEvictionGuard

      Disposable addEvictionGuard(Predicate<? super K> predicate)
      Protect eviction of certain keys as long as the guard is not disposed. Disposable may immediately evict all no longer guarded items
    • getPresentKeys

      Collection<K> getPresentKeys()
      Return a snapshot of all present keys
    • invalidateAll

      void invalidateAll()
    • invalidateAll

      void invalidateAll(Iterable<? extends K> keys)