public class TuQueuePolicy extends Object implements Policy
"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."
| Constructor and Description |
|---|
TuQueuePolicy(com.typesafe.config.Config config) |
| Modifier and Type | Method and Description |
|---|---|
void |
finished()
Indicates that the recording has completed.
|
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