public final class LfuPolicyHelper
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
LfuPolicyHelper.Metadata
A type representing relevant metadata from an element, used by LfuPolicy for its operations.
|
限定符和类型 | 方法和说明 |
---|---|
protected static int[] |
generateRandomSample(int populationSize)
Generates a random sample from a population
|
protected static LfuPolicyHelper.Metadata |
leastHit(LfuPolicyHelper.Metadata[] sampledElements,
LfuPolicyHelper.Metadata justAdded)
Finds the least hit of the sampled elements provided
|
protected static LfuPolicyHelper.Metadata leastHit(LfuPolicyHelper.Metadata[] sampledElements, LfuPolicyHelper.Metadata justAdded)
sampledElements
- this should be a random subset of the populationjustAdded
- we never want to select the element just added. May be null.protected static int[] generateRandomSample(int populationSize)
populationSize
- the size to draw from