Class ClimberResetCountMin4
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.admission.countmin4.CountMin4
-
- com.github.benmanes.caffeine.cache.simulator.admission.countmin4.ClimberResetCountMin4
-
-
Field Summary
-
Fields inherited from class com.github.benmanes.caffeine.cache.simulator.admission.countmin4.CountMin4
conservative, step, table, tableMask
-
-
Constructor Summary
Constructors Constructor Description ClimberResetCountMin4(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureCapacity(long maximumSize)Increases the capacity of this FrequencySketch instance, if necessary, to ensure that it can accurately estimate the popularity of elements given the maximum size of the cache.intfrequency(long e)Returns the estimated number of occurrences of an element, up to the maximum (15).intgetEventsToCount()intgetPeriod()intgetStep()voidincrement(long e)Increments the popularity of the element if it does not exceed the maximum (15).voidreportMiss()Feedback to allow for adaptability.voidresetEventsToCount()voidsetStep(int x)protected voidtryReset(boolean added)Reduces every counter by half of its original value.
-
-
-
Constructor Detail
-
ClimberResetCountMin4
public ClimberResetCountMin4(Config config)
-
-
Method Detail
-
ensureCapacity
protected void ensureCapacity(long maximumSize)
Description copied from class:CountMin4Increases the capacity of this FrequencySketch instance, if necessary, to ensure that it can accurately estimate the popularity of elements given the maximum size of the cache. This operation forgets all previous counts when resizing.- Overrides:
ensureCapacityin classCountMin4- Parameters:
maximumSize- the maximum size of the cache
-
frequency
public int frequency(long e)
Description copied from class:CountMin4Returns the estimated number of occurrences of an element, up to the maximum (15).
-
increment
public void increment(long e)
Description copied from class:CountMin4Increments the popularity of the element if it does not exceed the maximum (15). The popularity of all elements will be periodically down sampled when the observed events exceed a threshold. This process provides a frequency aging to allow expired long term entries to fade away.
-
tryReset
protected void tryReset(boolean added)
Reduces every counter by half of its original value. To reduce the truncation error, the sample is reduced by the number of counters with an odd value.
-
reportMiss
public void reportMiss()
Description copied from interface:FrequencyFeedback to allow for adaptability.
-
getStep
public int getStep()
-
setStep
public void setStep(int x)
-
getEventsToCount
public int getEventsToCount()
-
resetEventsToCount
public void resetEventsToCount()
-
getPeriod
public int getPeriod()
-
-