Class MultiQueuePolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.linked.MultiQueuePolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class MultiQueuePolicy extends Object implements Policy.KeyOnlyPolicy
The MultiQueue algorithm. This algorithm organizes entries into queues that represent a frequency range. When an entry is accessed, it may be promoted to the next higher queue and, regardless, is reordered to the least-recently-used position in the queue it resides in. A non-resident queue retains evicted items that are being monitored (OUT) to allow entries to retain their historic frequency and be eagerly promoted.This policy is designed for second-level caches where a hit in this cache was a miss at the first level. Thus, the first-level cache captures most of the recency information and the second-level cache access is dominated by usage frequency.
This implementation is based on the pseudocode provided by the authors in their paper The Multi-Queue Replacement Algorithm for Second Level. Buffer Caches.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec
-
-
Constructor Summary
Constructors Constructor Description MultiQueuePolicy(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrecord(long key)PolicyStatsstats()Returns the cache efficiency statistics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy
finished, name
-
Methods inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy.KeyOnlyPolicy
record
-
-
-
-
Constructor Detail
-
MultiQueuePolicy
public MultiQueuePolicy(Config config)
-
-
Method Detail
-
record
public void record(long key)
- Specified by:
recordin interfacePolicy.KeyOnlyPolicy
-
stats
public PolicyStats stats()
Description copied from interface:PolicyReturns the cache efficiency statistics.
-
-