Class FrdPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.irr.FrdPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class FrdPolicy extends Object implements Policy.KeyOnlyPolicy
Filtering-based Buffer Cache (FRD) algorithm. This algorithm organizes blocks by their reuse distance and partitions the cache into a filter and main space. The filter employs the LRU policy and accumulates new arrivals. The main space also employs LRU and holds history entries (filter and non-resident) and promoted resident entries. A resident entry is promoted when a miss occurs on a non-resident node, meaning that is has been used after having been evicted by the filter or main cache partitions.While the authors describe the filter entry and its history entry as distinct, thereby requiring two hash tables, this implementation merges them. Thus, during the main space's pruning operation an entry also in the filter space is treated as a history node, pruned, and remains in the hash table. This simplification should have no effect on the algorithm or its performance.
The algorithm is explained by the authors in FRD: A Filtering based Buffer Cache Algorithm that Considers both Frequency and Reuse Distance.
-
-
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
-
FrdPolicy
public FrdPolicy(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.
-
-