public final class TwoQueuePolicy extends Object implements Policy.KeyOnlyPolicy
This implementation is based on the pseudo code provided by the authors in their paper 2Q: A Low Overhead High Performance Buffer Management Replacement Algorithm. For consistency with other policies, this version places the next item to be removed at the head and most recently added at the tail of the queue.
Policy.Characteristic, Policy.KeyOnlyPolicy| Constructor and Description |
|---|
TwoQueuePolicy(Config config) |
| Modifier and Type | Method and Description |
|---|---|
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, waitcharacteristics, recordpublic TwoQueuePolicy(Config config)
public static Set<Policy> policies(Config config)
public void record(long key)
record in interface Policy.KeyOnlyPolicypublic PolicyStats stats()
Policy