Can we retrieve the least recently used key-value pair from the cache that is about to expire?
I want to use Caffeine as a memory map for values stored on disk. When the capacity is reached, I need to identify the next key-value pair set to expire and determine which value will free up space for storing new data on disk.
Yes, see cache.policy(). The expiration policy can return what it thinks are the oldest (next to expire) and the eviction policy the coldest (least recently/frequently used).
Can we retrieve the least recently used key-value pair from the cache that is about to expire?
I want to use Caffeine as a memory map for values stored on disk. When the capacity is reached, I need to identify the next key-value pair set to expire and determine which value will free up space for storing new data on disk.