Class WindowTinyLfuPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.sketch.WindowTinyLfuPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class WindowTinyLfuPolicy extends Object implements Policy.KeyOnlyPolicy
An adaption of the TinyLfu policy that adds a temporal admission window. This window allows the policy to have a high hit rate when entries exhibit a high temporal / low frequency pattern.A new entry starts in the window and remains there as long as it has high temporal locality. Eventually an entry will slip from the end of the window onto the front of the main queue. If the main queue is already full, then a historic frequency filter determines whether to evict the newly admitted entry or the victim entry chosen by main queue's policy. This process ensures that the entries in the main queue have both a high recency and frequency. The window space uses LRU and the main uses Segmented LRU.
Scan resistance is achieved by means of the window. Transient data will pass through from the window and not be accepted into the main queue. Responsiveness is maintained by the main queue's LRU and the TinyLfu's reset operation so that expired long term entries fade away.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWindowTinyLfuPolicy.WindowTinyLfuSettings-
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 WindowTinyLfuPolicy(double percentMain, WindowTinyLfuPolicy.WindowTinyLfuSettings settings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinished()Indicates that the recording has completed.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.KeyOnlyPolicy
record
-
-
-
-
Constructor Detail
-
WindowTinyLfuPolicy
public WindowTinyLfuPolicy(double percentMain, WindowTinyLfuPolicy.WindowTinyLfuSettings settings)
-
-
Method Detail
-
policies
public static Set<Policy> policies(Config config)
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
-
-