Class CountMin64TinyLfu

  • All Implemented Interfaces:
    Frequency

    public final class CountMin64TinyLfu
    extends Object
    implements Frequency
    A version of the TinyLFU sketch based on a regular conservative update sketch. The difference is that a counter may not exceed a maximum and any time the sum of events reach a predefined values we divide all counters by 2 in what is called a reset operation.

    For more details see TinyLFU: A Highly Efficient Cache Admission Policy.

    The CountMinSketch parameters are described in Twitter's implementation.

    • Constructor Detail

      • CountMin64TinyLfu

        public CountMin64TinyLfu​(Config config)
    • Method Detail

      • frequency

        public int frequency​(long o)
        Returns the estimated usage frequency of the item.
        Specified by:
        frequency in interface Frequency
      • increment

        public void increment​(long o)
        Description copied from interface: Frequency
        Increments the popularity of the element.
        Specified by:
        increment in interface Frequency