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, Policy.PolicySpec| Constructor and Description |
|---|
TwoQueuePolicy(Config config) |
| Modifier and Type | Method and Description |
|---|---|
void |
record(long key) |
PolicyStats |
stats()
Returns the cache efficiency statistics.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrecordpublic TwoQueuePolicy(Config config)
public void record(long key)
record in interface Policy.KeyOnlyPolicypublic PolicyStats stats()
Policy