public final class SegmentedLruPolicy extends Object implements Policy.KeyOnlyPolicy
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
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec| Constructor and Description |
|---|
SegmentedLruPolicy(Admission admission,
Config config) |
| Modifier and Type | Method and Description |
|---|---|
static Set<Policy> |
policies(Config config)
Returns all variations of this policy based on the configuration parameters.
|
void |
record(long key) |
PolicyStats |
stats()
Returns the cache efficiency statistics.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrecordpublic static Set<Policy> policies(Config config)
public void record(long key)
record in interface Policy.KeyOnlyPolicypublic PolicyStats stats()
Policy