public final class WindowTinyLfuPolicy extends Object implements Policy
A new entry starts in the eden queue and remains there as long as it has high temporal locality. Eventually an entry will slip from the end of the eden queue 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 eden space uses LRU and the main uses Segmented LRU.
Scan resistance is achieved by means of the eden queue. Transient data will pass through from the eden queue 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.
| Constructor and Description |
|---|
WindowTinyLfuPolicy(double percentMain,
com.github.benmanes.caffeine.cache.simulator.policy.sketch.WindowTinyLfuPolicy.WindowTinyLfuSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
finished()
Indicates that the recording has completed.
|
static Set<Policy> |
policies(com.typesafe.config.Config config)
Returns all variations of this policy based on the configuration parameters.
|
void |
record(long key)
Records that the entry was accessed.
|
PolicyStats |
stats()
Returns the cache efficiency statistics.
|
public WindowTinyLfuPolicy(double percentMain,
com.github.benmanes.caffeine.cache.simulator.policy.sketch.WindowTinyLfuPolicy.WindowTinyLfuSettings settings)
public static Set<Policy> policies(com.typesafe.config.Config config)
public PolicyStats stats()
Policypublic void record(long key)
Policy