Package org.apache.pekko.util
Class FrequencySketch$
- java.lang.Object
-
- org.apache.pekko.util.FrequencySketch$
-
public class FrequencySketch$ extends java.lang.Object
INTERNAL APIA 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
Fields Modifier and Type Field Description static FrequencySketch$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description FrequencySketch$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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
apply$default$2()
<A> double
apply$default$3()
<A> int
apply$default$4()
<A> int
apply$default$5()
-
-
-
Field Detail
-
MODULE$
public static final FrequencySketch$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
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()
-
-