Package org.apache.hadoop.hbase.util
Class LossyCounting<T>
java.lang.Object
org.apache.hadoop.hbase.util.LossyCounting<T>
LossyCounting utility, bounded data structure that maintains approximate high frequency elements
in data stream. Bucket size is 1 / error rate. (Error rate is 0.02 by default) Lemma If element
does not appear in set, then is frequency is less than e * N (N is total element counts until
now.) Based on paper: http://www.vldb.org/conf/2002/S10P03.pdf
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private int
private final ExecutorService
private static AtomicReference<Future<?>>
private LossyCounting.LossyCountingListener<T>
private static final org.slf4j.Logger
private final String
private long
-
Constructor Summary
ConstructorDescriptionLossyCounting
(String name, double errorRate) LossyCounting
(String name, double errorRate, LossyCounting.LossyCountingListener<T> listener) LossyCounting
(String name, org.apache.hadoop.conf.Configuration conf) LossyCounting
(String name, org.apache.hadoop.conf.Configuration conf, LossyCounting.LossyCountingListener<T> listener) -
Method Summary
-
Field Details
-
LOG
-
executor
-
bucketSize
-
currentTerm
-
data
-
totalDataCount
-
name
-
listener
-
fut
-
-
Constructor Details
-
LossyCounting
LossyCounting(String name, double errorRate) -
LossyCounting
public LossyCounting(String name, double errorRate, LossyCounting.LossyCountingListener<T> listener) -
LossyCounting
LossyCounting(String name, org.apache.hadoop.conf.Configuration conf) -
LossyCounting
public LossyCounting(String name, org.apache.hadoop.conf.Configuration conf, LossyCounting.LossyCountingListener<T> listener)
-
-
Method Details
-
addByOne
-
add
-
sweep
sweep low frequency data -
calculateCurrentTerm
Calculate and set current term -
getBucketSize
-
getDataSize
-
contains
-
getElements
-
getCurrentTerm
-
getSweepFuture
-