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