Class FrequencySketch$

java.lang.Object
org.apache.pekko.util.FrequencySketch$

public class FrequencySketch$ extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final FrequencySketch$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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
     
    <A> double
     
    <A> int
     
    <A> int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MODULE$

      public static final FrequencySketch$ 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 sketch
      resetMultiplier - the multiplier on the capacity for the reset size
      depth - 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 bits
      hasher - 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()