com.espertech.esper.epl.approx
Class CountMinSketchStateHashes

java.lang.Object
  extended by com.espertech.esper.epl.approx.CountMinSketchStateHashes

public class CountMinSketchStateHashes
extends java.lang.Object

Count–min sketch (or CM sketch) is a probabilistic sub-linear space streaming algorithm (source: Wikipedia, see http://en.wikipedia.org/wiki/Count%E2%80%93min_sketch)

Count-min sketch computes an approximate frequency and thereby top-k or heavy-hitters.

Paper: Graham Cormode and S. Muthukrishnan. An improved data stream summary: The Count-Min sketch and its applications. 2004. 10.1016/j.jalgor.2003.12.001 http://dl.acm.org/citation.cfm?id=1073718


Constructor Summary
CountMinSketchStateHashes(int depth, int width, long[][] table, long[] hash, long total)
           
 
Method Summary
 void add(byte[] item, long count)
           
 long estimateCount(byte[] item)
           
 int getDepth()
           
 long[] getHash()
           
 long[][] getTable()
           
 long getTotal()
           
 int getWidth()
           
 void incTotal(long count)
           
static CountMinSketchStateHashes makeState(CountMinSketchSpecHashes spec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountMinSketchStateHashes

public CountMinSketchStateHashes(int depth,
                                 int width,
                                 long[][] table,
                                 long[] hash,
                                 long total)
Method Detail

makeState

public static CountMinSketchStateHashes makeState(CountMinSketchSpecHashes spec)

getTable

public long[][] getTable()

getHash

public long[] getHash()

getDepth

public int getDepth()

getWidth

public int getWidth()

incTotal

public void incTotal(long count)

getTotal

public long getTotal()

estimateCount

public long estimateCount(byte[] item)

add

public void add(byte[] item,
                long count)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com