T
- the type of instances that the ClockCuckooFilter
acceptspublic interface ClockCuckooFilter<T>
Cuckoo filter is an approximate structure for membership query. Apart from Put and Get, it also supports deleting items from filter, which is not allowed in bloom filter. See "Cuckoo Filter: Practically Better Than Bloom" by Fan et al. for more detailed description.
Clock cuckoo filter is an extension of basic cuckoo filter. Specifically, it has the following features: 1) sliding window model: it will automatically delete stale items, which means they are not accessed over a recent interval; 2) size estimation: it can not only report the approximate number of unique items in it, but also the total size of those items; 3) hierarchy: we assume items are organized in a hierarchical level structure, and it can report the statistics of a specific level.
Modifier and Type | Method and Description |
---|---|
void |
aging()
A thread-safe method to check aging progress of each segment.
|
long |
approximateElementCount() |
long |
approximateElementCount(CacheScope scopeInfo) |
long |
approximateElementSize() |
long |
approximateElementSize(CacheScope scopeInfo) |
boolean |
delete(T item)
Delete an item from cuckoo filter.
|
double |
expectedFpp() |
boolean |
mightContain(T item)
Check whether an item is in cuckoo filter or not.
|
boolean |
mightContainAndResetClock(T item)
Check whether an item is in cuckoo filter (and reset its clock to MAX) or not.
|
boolean |
put(T item,
int size,
CacheScope scopeInfo)
Insert an item into cuckoo filter.
|
boolean put(T item, int size, CacheScope scopeInfo)
item
- the object to be insertedsize
- the size of this itemscopeInfo
- the scope this item belongs toboolean mightContainAndResetClock(T item)
item
- the item to be checkedboolean mightContain(T item)
item
- the item to be checkedboolean delete(T item)
item
- the item to be deletedvoid aging()
double expectedFpp()
true
for an object that has not actually been put in the ConcurrentCuckooFilter
.long approximateElementCount()
long approximateElementCount(CacheScope scopeInfo)
scopeInfo
- the scope to be queriedlong approximateElementSize()
long approximateElementSize(CacheScope scopeInfo)
scopeInfo
- the scope to be queriedCopyright © 2023. All Rights Reserved.