Class FrequentlyUsedPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.linked.FrequentlyUsedPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class FrequentlyUsedPolicy extends Object implements Policy.KeyOnlyPolicy
Least/Most Frequency Used in O(1) time as described in An O(1) algorithm for implementing the LFU cache eviction scheme.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFrequentlyUsedPolicy.EvictionPolicy-
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 FrequentlyUsedPolicy(Admission admission, FrequentlyUsedPolicy.EvictionPolicy policy, Config config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Set<Policy>policies(Config config, FrequentlyUsedPolicy.EvictionPolicy policy)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
-
-
-
-
Constructor Detail
-
FrequentlyUsedPolicy
public FrequentlyUsedPolicy(Admission admission, FrequentlyUsedPolicy.EvictionPolicy policy, Config config)
-
-
Method Detail
-
policies
public static Set<Policy> policies(Config config, FrequentlyUsedPolicy.EvictionPolicy policy)
Returns all variations of this policy based on the configuration parameters.
-
stats
public PolicyStats stats()
Description copied from interface:PolicyReturns the cache efficiency statistics.
-
record
public void record(long key)
- Specified by:
recordin interfacePolicy.KeyOnlyPolicy
-
-