Package akka.remote.artery.compress
Class CountMinSketch
- java.lang.Object
- 
- akka.remote.artery.compress.CountMinSketch
 
- 
 public class CountMinSketch extends java.lang.ObjectINTERNAL API: Count-Min Sketch datastructure.Not thread-safe. An Improved Data Stream Summary: The Count-Min Sketch and its Applications https://web.archive.org/web/20060907232042/http://www.eecs.harvard.edu/~michaelm/CS222/countmin.pdf This implementation is mostly taken and adjusted from the Apache V2 licensed project `stream-lib`, located here: https://github.com/clearspring/stream-lib/blob/master/src/main/java/com/clearspring/analytics/stream/frequency/CountMinSketch.java 
- 
- 
Constructor SummaryConstructors Constructor Description CountMinSketch(int depth, int width, int seed)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddObjectAndEstimateCount(java.lang.Object item, long count)Similar toadd, however we reuse the fact that the hask buckets have to be calculated foraddalready, and a separateestimateCountoperation would have to calculate them again, so we do it all in one go.doubleconfidence()longestimateCount(java.lang.Object item)The estimate is correct within'epsilon' * (total item count), with probabilityconfidence.doublerelativeError()Referred to asepsilonin the whitepaperlongsize()java.lang.StringtoString()
 
- 
- 
- 
Method Detail- 
relativeErrorpublic double relativeError() Referred to asepsilonin the whitepaper
 - 
confidencepublic double confidence() 
 - 
addObjectAndEstimateCountpublic long addObjectAndEstimateCount(java.lang.Object item, long count)Similar toadd, however we reuse the fact that the hask buckets have to be calculated foraddalready, and a separateestimateCountoperation would have to calculate them again, so we do it all in one go.
 - 
sizepublic long size() 
 - 
estimateCountpublic long estimateCount(java.lang.Object item) The estimate is correct within'epsilon' * (total item count), with probabilityconfidence.
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-