public class AdaptiveCounting extends LogLog
Based on the adaptive counting approach of:
Fast and Accurate Traffic Matrix Measurement Using Adaptive Cardinality Counting
by: Cai, Pan, Kwok, and Hwang
| Modifier and Type | Class and Description |
|---|---|
static class |
AdaptiveCounting.Builder |
LogLog.LogLogMergeException| Modifier and Type | Field and Description |
|---|---|
protected int |
b_e
Number of empty buckets
|
protected double |
B_s
Switching empty bucket ratio
|
| Constructor and Description |
|---|
AdaptiveCounting(byte[] M) |
AdaptiveCounting(int k) |
| Modifier and Type | Method and Description |
|---|---|
long |
cardinality() |
ICardinality |
merge(ICardinality... estimators)
Merges estimators to produce a new estimator for the combined streams
of this estimator and those passed as arguments.
|
static AdaptiveCounting |
mergeEstimators(LogLog... estimators)
Merges estimators to produce an estimator for their combined streams
|
boolean |
offer(Object o) |
protected static byte |
rho(long x,
int k)
Computes the position of the first set bit of the last Long.SIZE-k bits
|
getBytes, offerHashed, offerHashed, rho, sizeofprotected int b_e
protected final double B_s
public AdaptiveCounting(int k)
public AdaptiveCounting(byte[] M)
public boolean offer(Object o)
offer in interface ICardinalityoffer in class LogLogo - stream elementpublic long cardinality()
cardinality in interface ICardinalitycardinality in class LogLogprotected static byte rho(long x,
int k)
public ICardinality merge(ICardinality... estimators) throws LogLog.LogLogMergeException
ICardinalitymerge in interface ICardinalitymerge in class LogLogestimators - Zero or more compatible estimatorsLogLogMergeException - if estimators are not mergeable (all estimators must be instances of LogLog of the same size)LogLog.LogLogMergeExceptionpublic static AdaptiveCounting mergeEstimators(LogLog... estimators) throws LogLog.LogLogMergeException
estimators - LogLogMergeException - if estimators are not mergeable (all estimators must be the same size)LogLog.LogLogMergeExceptionCopyright © 2014. All Rights Reserved.