Class SegmentedLruPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.linked.SegmentedLruPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class SegmentedLruPolicy extends Object implements Policy.KeyOnlyPolicy
"Segmented LRU is based on the observation that objects with at least two accesses are much more popular than those with only one access during a short interval. In Segmented LRU, cache space is partitioned into two segments: probationary segment and protected segment.New objects (with only one access) are first faulted into the probationary segment, whereas objects with two or more accesses are kept in the protected segment. When a probationary object gets one more reference, it will change to the protected segment. When the whole cache space becomes full, the least recently used object in the probationary segment will first be replaced. The protected segment is finite in size. When it gets full, the overflowed will be re-cached in probationary segment. Since objects in protected segment have to go a longer way before being evicted, popular object or an object with more accesses tends to be kept in cache for longer time." from LRU-SP: A Size-Adjusted and Popularity-Aware LRU Replacement Algorithm for Web Caching
-
-
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 SegmentedLruPolicy(Admission admission, Config config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Set<Policy>policies(Config config)Returns all variations of this policy based on the configuration parameters.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
-
-
-
-
Method Detail
-
policies
public static Set<Policy> policies(Config config)
Returns all variations of this policy based on the configuration parameters.
-
record
public void record(long key)
- Specified by:
recordin interfacePolicy.KeyOnlyPolicy
-
stats
public PolicyStats stats()
Description copied from interface:PolicyReturns the cache efficiency statistics.
-
-