public final class WindowTinyLfuPolicy extends Object implements Policy.KeyOnlyPolicy
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
WindowTinyLfuPolicy.WindowTinyLfuSettings |
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec| Constructor and Description |
|---|
WindowTinyLfuPolicy(double percentMain,
WindowTinyLfuPolicy.WindowTinyLfuSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
finished()
Indicates that the recording has completed.
|
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 WindowTinyLfuPolicy(double percentMain,
WindowTinyLfuPolicy.WindowTinyLfuSettings settings)
public static Set<Policy> policies(Config config)
public PolicyStats stats()
Policypublic void record(long key)
record in interface Policy.KeyOnlyPolicy