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, sizeof
protected int b_e
protected final double B_s
public AdaptiveCounting(int k)
public AdaptiveCounting(byte[] M)
public boolean offer(Object o)
offer
in interface ICardinality
offer
in class LogLog
o
- stream elementpublic long cardinality()
cardinality
in interface ICardinality
cardinality
in class LogLog
protected static byte rho(long x, int k)
public ICardinality merge(ICardinality... estimators) throws LogLog.LogLogMergeException
ICardinality
merge
in interface ICardinality
merge
in class LogLog
estimators
- Zero or more compatible estimatorsLogLogMergeException
- if estimators are not mergeable (all estimators must be instances of LogLog of the same size)LogLog.LogLogMergeException
public static AdaptiveCounting mergeEstimators(LogLog... estimators) throws LogLog.LogLogMergeException
estimators
- LogLogMergeException
- if estimators are not mergeable (all estimators must be the same size)LogLog.LogLogMergeException
Copyright © 2019. All rights reserved.