Class CountMinSketch


  • public class CountMinSketch
    extends java.lang.Object
    A count-min sketch implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      CountMinSketch​(int k, int m)
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long hash)  
      long addAndEstimate​(long hash)
      Add an entry.
      long estimate​(long hash)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CountMinSketch

        public CountMinSketch​(int k,
                              int m)
        Create a new instance.
        Parameters:
        k - the number of hash functions
        m - the number of buckets per hash function (must be a power of 2)
    • Method Detail

      • addAndEstimate

        public long addAndEstimate​(long hash)
        Add an entry.
        Parameters:
        hash - the hash
        Returns:
        the new estimation
      • add

        public void add​(long hash)
      • estimate

        public long estimate​(long hash)