public class TuQueuePolicy extends Object implements Policy.KeyOnlyPolicy
"We retain the key three working set distinction. In the OpenBSD code, they are named hot, cold, and warm, and each is an LRU queue. New buffers start hot. They stay that way as long as they remain on the hot queue. Eventually, a buffer will slip from the end of the hot queue onto the front of the cold queue. (We preserve the data, not just the address.) When a new buffer is needed, we recycle one from the tail of the cold queue. The oldest and coldest. If, on the other hand, we have a cache hit on a cold buffer, it turns into a warm buffer and goes to the front of the warm queue. Then as the warm queue lengthens, buffers start slipping from the end onto the cold queue. Both the hot and warm queues are capped at one third of memory each to ensure balance."
Scan resistance is achieved by means of the warm queue. Transient data will pass from hot queue to cold queue and be recycled. Responsiveness is maintained by making the warm queue LRU so that expired long term set buffers fade away."
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec| Constructor and Description |
|---|
TuQueuePolicy(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 TuQueuePolicy(Config config)
public void record(long key)
record in interface Policy.KeyOnlyPolicypublic PolicyStats stats()
Policy