Class ArcPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.adaptive.ArcPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class ArcPolicy extends Object implements Policy.KeyOnlyPolicy
Adaptive Replacement Cache. This algorithm uses a queue for items that are seen once (T1), a queue for items seen multiple times (T2), and non-resident queues for evicted items that are being monitored (B1, B2). The maximum size of the T1 and T2 queues is adjusted dynamically based on the workload patterns and effectiveness of the cache.This implementation is based on the pseudocode provided by the authors in their paper Outperforming LRU with an Adaptive Replacement Cache Algorithm and is further described in their paper, ARC: A Self-Tuning, Low Overhead Replacement Cache.
This algorithm is patented by IBM (6996676, 7096321, 7058766, 8612689) and Sun (7469320), making its use in applications ambiguous due to Sun's ZFS providing an implementation under the CDDL.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinished()Indicates that the recording has completed.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.KeyOnlyPolicy
record
-
-
-
-
Constructor Detail
-
ArcPolicy
public ArcPolicy(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.
-
-