public final class TwoQueuePolicy extends Object implements Policy
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.
| Constructor and Description |
|---|
TwoQueuePolicy(com.typesafe.config.Config config) |
| Modifier and Type | Method and Description |
|---|---|
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 static Set<Policy> policies(com.typesafe.config.Config config)
public void record(long key)
Policypublic PolicyStats stats()
Policy