Class CarPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.adaptive.CarPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class CarPolicy extends Object implements Policy.KeyOnlyPolicy
Clock with Adaptive Replacement policy. This algorithm differs from ARC by replacing the LRU policy with the Clock (Second Chance) policy. This allows cache hits to be performed concurrently at the cost of a global lock on a miss and has the worst case time of O(2n) on eviction due to queues being scanned.This implementation is based on the pseudo code provided by the authors in their paper CAR: Clock with Adaptive Replacement and is further described in their paper,
This algorithm is patented by IBM (6996676, 7096321, 7058766, 8612689).
-
-
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
-
CarPolicy
public CarPolicy(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.
-
-