public final class ClockProPolicy extends Object implements Policy.KeyOnlyPolicy
ClockPro uses three hands that scan the queue. The hot hand points to the largest recency, the cold hand to the cold entry furthest from the hot hand, and the test hand to the last cold entry in the test period. This policy is adaptive by adjusting the percentage of hot and cold entries that may reside in the cache. It uses non-resident (ghost) entries to retain additional history, which are removed during the test hand's scan. The algorithm is explained by the authors in CLOCK-Pro: An Effective Improvement of the CLOCK Replacement and Clock-Pro: An Effective Replacement in OS Kernel.
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec| Constructor and Description |
|---|
ClockProPolicy(Config config) |
| Modifier and Type | Method and Description |
|---|---|
void |
finished()
Indicates that the recording has completed.
|
void |
record(long key) |
PolicyStats |
stats()
Returns the cache efficiency statistics.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrecordpublic ClockProPolicy(Config config)
public PolicyStats stats()
Policypublic void finished()
Policypublic void record(long key)
record in interface Policy.KeyOnlyPolicy