Package org.apache.pekko.util
Class FrequencySketch$
java.lang.Object
org.apache.pekko.util.FrequencySketch$
INTERNAL API
A frequency sketch for estimating the popularity of items. For implementing the TinyLFU cache admission policy. The frequency sketch includes the TinyLFU reset operation, which periodically halves all counters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FrequencySketch$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A> org.apache.pekko.util.FrequencySketch<A>apply(int capacity, int widthMultiplier, double resetMultiplier, int depth, int counterBits, org.apache.pekko.util.FrequencySketch.Hasher<A> hasher) Create a new FrequencySketch based on the cache capacity (which will be increased to the nearest power of two).<A> int<A> double<A> int<A> int
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
FrequencySketch$
public FrequencySketch$()
-
-
Method Details
-
apply
public <A> org.apache.pekko.util.FrequencySketch<A> apply(int capacity, int widthMultiplier, double resetMultiplier, int depth, int counterBits, org.apache.pekko.util.FrequencySketch.Hasher<A> hasher) Create a new FrequencySketch based on the cache capacity (which will be increased to the nearest power of two).- Parameters:
capacity- the cache capacity (maximum items that will be cached)widthMultiplier- a multiplier for the width of the sketchresetMultiplier- the multiplier on the capacity for the reset sizedepth- the depth of count-min sketch (number of hash functions)counterBits- the size of the counters in bits: 2, 4, 8, 16, 32, or 64 bitshasher- the hash function for the element type- Returns:
- a configured FrequencySketch
-
apply$default$2
public <A> int apply$default$2() -
apply$default$3
public <A> double apply$default$3() -
apply$default$4
public <A> int apply$default$4() -
apply$default$5
public <A> int apply$default$5()
-