public final class SampledPolicy extends Object implements Policy.KeyOnlyPolicy
The sampling approach for an approximate of classical policies is described Efficient Randomized Web Cache Replacement Schemes Using Samples from Past Eviction Times. The Hyperbolic algorithm is a newer addition to this family and is described in Hyperbolic Caching: Flexible Caching for Web Applications.
| Modifier and Type | Class and Description |
|---|---|
static class |
SampledPolicy.EvictionPolicy
The replacement policy.
|
static class |
SampledPolicy.Sample
The algorithms to choose a random sample with.
|
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec| Constructor and Description |
|---|
SampledPolicy(Admission admission,
SampledPolicy.EvictionPolicy policy,
Config config) |
| Modifier and Type | Method and Description |
|---|---|
static Set<Policy> |
policies(Config config,
SampledPolicy.EvictionPolicy policy)
Returns all variations of this policy based on the configuration parameters.
|
void |
record(long key) |
PolicyStats |
stats()
Returns the cache efficiency statistics.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrecordpublic SampledPolicy(Admission admission, SampledPolicy.EvictionPolicy policy, Config config)
public static Set<Policy> policies(Config config, SampledPolicy.EvictionPolicy policy)
public PolicyStats stats()
Policypublic void record(long key)
record in interface Policy.KeyOnlyPolicy