public class SlidingCuckooFilter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
bucketsize
The bucket size / entries per bucker.
|
protected NanoCuckooFilter |
currentfilter
The current filter.
|
protected NanoCuckooFilter |
expiringfilter
The currently expiring filter.
|
protected byte |
fingerprintsize
Size of fingerprints in bits.
|
Constructor and Description |
---|
SlidingCuckooFilter()
Creates the cuckoo filter with the given capacity and
a false positive probability of ~1:500000.
|
SlidingCuckooFilter(long capacity,
int bucketsize,
byte fingerprintsize)
Creates the cuckoo filter with the given capacity and
false positive probability.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String string)
Check if a given byte array is contained in the filter.
|
protected NanoCuckooFilter |
createFilter(long capacity)
Creates a new filter.
|
void |
delete(java.lang.String val)
Delete a value from the filter.
|
void |
insert(java.lang.String string)
Insert a byte array into the filter.
|
protected NanoCuckooFilter expiringfilter
protected NanoCuckooFilter currentfilter
protected int bucketsize
protected byte fingerprintsize
public SlidingCuckooFilter()
capacity
- Capacity.public SlidingCuckooFilter(long capacity, int bucketsize, byte fingerprintsize)
capacity
- Filter capacity of a single filter.bucketsize
- Size of buckets.fingerprintsize
- Size of fingerprints.public void insert(java.lang.String string)
string
- The data being inserted.public void delete(java.lang.String val)
val
- The value to delete.public boolean contains(java.lang.String string)
data
- The data being checked.protected NanoCuckooFilter createFilter(long capacity)
capacity
- Filter capacity.bucketsize
- Size of bucketsfingerprintsize
- Size of fingerprints.