public class CountMinSketchStateHashes extends 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 and Description |
---|
CountMinSketchStateHashes(int depth,
int width,
long[][] table,
long[] hash,
long total) |
Modifier and Type | Method and Description |
---|---|
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) |
public CountMinSketchStateHashes(int depth, int width, long[][] table, long[] hash, long total)
public static CountMinSketchStateHashes makeState(CountMinSketchSpecHashes spec)
public long[][] getTable()
public long[] getHash()
public int getDepth()
public int getWidth()
public void incTotal(long count)
public long getTotal()
public long estimateCount(byte[] item)
public void add(byte[] item, long count)