Class CountMinSketchStateHashes
java.lang.Object
com.espertech.esper.common.internal.epl.approx.countminsketch.CountMinSketchStateHashes
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
ConstructorDescriptionCountMinSketchStateHashes
(int depth, int width, long[][] table, long[] hash, long total) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
-
Constructor Details
-
CountMinSketchStateHashes
public CountMinSketchStateHashes(int depth, int width, long[][] table, long[] hash, long total)
-
-
Method Details
-
makeState
-
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)
-