@InterfaceAudience.Private public class LossyCounting<T> extends Object
| Modifier and Type | Class and Description | 
|---|---|
| static interface  | LossyCounting.LossyCountingListener<T> | 
| (package private) class  | LossyCounting.SweepRunnable | 
| Modifier and Type | Field and Description | 
|---|---|
| private long | bucketSize | 
| private int | currentTerm | 
| private Map<T,Integer> | data | 
| private ExecutorService | executor | 
| private static AtomicReference<Future<?>> | fut | 
| private LossyCounting.LossyCountingListener<T> | listener | 
| private static org.slf4j.Logger | LOG | 
| private String | name | 
| private long | totalDataCount | 
| Constructor and Description | 
|---|
| LossyCounting(String name,
             org.apache.hadoop.conf.Configuration conf) | 
| LossyCounting(String name,
             org.apache.hadoop.conf.Configuration conf,
             LossyCounting.LossyCountingListener<T> listener) | 
| LossyCounting(String name,
             double errorRate) | 
| LossyCounting(String name,
             double errorRate,
             LossyCounting.LossyCountingListener<T> listener) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | add(T key) | 
| private void | addByOne(T key) | 
| private void | calculateCurrentTerm()Calculate and set current term | 
| boolean | contains(T key) | 
| long | getBucketSize() | 
| long | getCurrentTerm() | 
| long | getDataSize() | 
| Set<T> | getElements() | 
| Future<?> | getSweepFuture() | 
| void | sweep()sweep low frequency data | 
private static final org.slf4j.Logger LOG
private final ExecutorService executor
private long bucketSize
private int currentTerm
private long totalDataCount
private LossyCounting.LossyCountingListener<T> listener
private static AtomicReference<Future<?>> fut
LossyCounting(String name, double errorRate)
public LossyCounting(String name, double errorRate, LossyCounting.LossyCountingListener<T> listener)
LossyCounting(String name, org.apache.hadoop.conf.Configuration conf)
public LossyCounting(String name, org.apache.hadoop.conf.Configuration conf, LossyCounting.LossyCountingListener<T> listener)
public void sweep()
private void calculateCurrentTerm()
public long getBucketSize()
public long getDataSize()
public Set<T> getElements()
public long getCurrentTerm()
public Future<?> getSweepFuture()
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.