T
- the type of itempublic class ConcurrentClockCuckooFilter<T> extends Object implements ClockCuckooFilter<T>, Serializable
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_FPP |
static double |
DEFAULT_LOAD_FACTOR |
static int |
TAGS_PER_BUCKET |
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) |
static <T> ConcurrentClockCuckooFilter<T> |
create(com.google.common.hash.Funnel<? super T> funnel,
long expectedInsertions,
int bitsPerClock,
int bitsPerSize,
int bitsPerScope)
Create a concurrent cuckoo filter with specified parameters.
|
static <T> ConcurrentClockCuckooFilter<T> |
create(com.google.common.hash.Funnel<? super T> funnel,
long expectedInsertions,
int bitsPerClock,
int bitsPerScope,
int prefixBits,
int suffixBits,
SlidingWindowType slidingWindowType,
long windowSize,
double fpp,
double loadFactor,
com.google.common.hash.HashFunction hasher)
Create a concurrent cuckoo filter with size encoder.
|
static <T> ConcurrentClockCuckooFilter<T> |
create(com.google.common.hash.Funnel<? super T> funnel,
long expectedInsertions,
int bitsPerClock,
int bitsPerSize,
int bitsPerScope,
SlidingWindowType slidingWindowType,
long windowSize)
Create a concurrent cuckoo filter with specified parameters.
|
static <T> ConcurrentClockCuckooFilter<T> |
create(com.google.common.hash.Funnel<? super T> funnel,
long expectedInsertions,
int bitsPerClock,
int bitsPerSize,
int bitsPerScope,
SlidingWindowType slidingWindowType,
long windowSize,
double fpp)
Create a concurrent cuckoo filter with specified parameters.
|
static <T> ConcurrentClockCuckooFilter<T> |
create(com.google.common.hash.Funnel<? super T> funnel,
long expectedInsertions,
int bitsPerClock,
int bitsPerSize,
int bitsPerScope,
SlidingWindowType slidingWindowType,
long windowSize,
double fpp,
double loadFactor)
Create a concurrent cuckoo filter with specified parameters.
|
static <T> ConcurrentClockCuckooFilter<T> |
create(com.google.common.hash.Funnel<? super T> funnel,
long expectedInsertions,
int bitsPerClock,
int bitsPerSize,
int bitsPerScope,
SlidingWindowType slidingWindowType,
long windowSize,
double fpp,
double loadFactor,
com.google.common.hash.HashFunction hasher)
Create a concurrent cuckoo filter with specified parameters.
|
boolean |
delete(T item)
Delete an item from cuckoo filter.
|
double |
expectedFpp() |
int |
getAge(T item)
Get the item's clock value (age).
|
int |
getBitsPerClock() |
int |
getBitsPerScope() |
int |
getBitsPerSize() |
int |
getBitsPerTag() |
int |
getNumBuckets() |
String |
getSummary() |
int |
getTagsPerBucket() |
void |
increaseOperationCount(int count)
By calling this method, cuckoo filter is informed of the number of entries have passed.
|
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.
|
public static final double DEFAULT_FPP
public static final double DEFAULT_LOAD_FACTOR
public static final int TAGS_PER_BUCKET
public static <T> ConcurrentClockCuckooFilter<T> create(com.google.common.hash.Funnel<? super T> funnel, long expectedInsertions, int bitsPerClock, int bitsPerSize, int bitsPerScope, SlidingWindowType slidingWindowType, long windowSize, double fpp, double loadFactor, com.google.common.hash.HashFunction hasher)
T
- the type of itemfunnel
- the funnel of T's that the constructed cuckoo filter will useexpectedInsertions
- the number of expected insertions to the constructed ConcurrentClockCuckooFilter
; must be positive; must be a power of 2bitsPerClock
- the number of bits the clock field hasbitsPerSize
- the number of bits the size field hasbitsPerScope
- the number of bits the scope field hasslidingWindowType
- the type of sliding windowwindowSize
- the size of the sliding windowfpp
- the desired false positive probability (must be positive and less than 1.0)loadFactor
- the load factor of cuckoo filter (must be positive and less than 1.0)hasher
- the hash function to be usedConcurrentClockCuckooFilter
public static <T> ConcurrentClockCuckooFilter<T> create(com.google.common.hash.Funnel<? super T> funnel, long expectedInsertions, int bitsPerClock, int bitsPerScope, int prefixBits, int suffixBits, SlidingWindowType slidingWindowType, long windowSize, double fpp, double loadFactor, com.google.common.hash.HashFunction hasher)
T
- the type of itemfunnel
- the funnel of T's that the constructed cuckoo filter will useexpectedInsertions
- the number of expected insertions to the constructed ConcurrentClockCuckooFilter
; must be positive; must be a power of 2bitsPerClock
- the number of bits the clock field hasbitsPerScope
- the number of bits the scope field hasprefixBits
- the prefix bits number of the size fieldsuffixBits
- the suffix bits number of the size fieldslidingWindowType
- the type of sliding windowwindowSize
- the size of the sliding windowfpp
- the desired false positive probability (must be positive and less than 1.0)loadFactor
- the load factor of cuckoo filter (must be positive and less than 1.0)hasher
- the hash function to be usedConcurrentClockCuckooFilter
public static <T> ConcurrentClockCuckooFilter<T> create(com.google.common.hash.Funnel<? super T> funnel, long expectedInsertions, int bitsPerClock, int bitsPerSize, int bitsPerScope, SlidingWindowType slidingWindowType, long windowSize, double fpp, double loadFactor)
T
- the type of itemfunnel
- the funnel of T's that the constructed BloomFilter
will useexpectedInsertions
- the number of expected insertions to the constructed ConcurrentClockCuckooFilter
; must be positive; must be a power of 2bitsPerClock
- the number of bits the clock field hasbitsPerSize
- the number of bits the size field hasbitsPerScope
- the number of bits the scope field hasslidingWindowType
- the type of sliding windowwindowSize
- the size of the sliding windowfpp
- the desired false positive probability (must be positive and less than 1.0)loadFactor
- the load factor of cuckoo filter (must be positive and less than 1.0)ConcurrentClockCuckooFilter
public static <T> ConcurrentClockCuckooFilter<T> create(com.google.common.hash.Funnel<? super T> funnel, long expectedInsertions, int bitsPerClock, int bitsPerSize, int bitsPerScope, SlidingWindowType slidingWindowType, long windowSize, double fpp)
T
- the type of itemfunnel
- the funnel of T's that the constructed BloomFilter
will useexpectedInsertions
- the number of expected insertions to the constructed ConcurrentClockCuckooFilter
; must be positive; must be a power of 2bitsPerClock
- the number of bits the clock field hasbitsPerSize
- the number of bits the size field hasbitsPerScope
- the number of bits the scope field hasslidingWindowType
- the type of sliding windowwindowSize
- the size of the sliding windowfpp
- the desired false positive probability (must be positive and less than 1.0)ConcurrentClockCuckooFilter
public static <T> ConcurrentClockCuckooFilter<T> create(com.google.common.hash.Funnel<? super T> funnel, long expectedInsertions, int bitsPerClock, int bitsPerSize, int bitsPerScope, SlidingWindowType slidingWindowType, long windowSize)
T
- the type of itemfunnel
- the funnel of T's that the constructed BloomFilter
will useexpectedInsertions
- the number of expected insertions to the constructed ConcurrentClockCuckooFilter
; must be positive; must be a power of 2bitsPerClock
- the number of bits the clock field hasbitsPerSize
- the number of bits the size field hasbitsPerScope
- the number of bits the scope field hasslidingWindowType
- the type of sliding windowwindowSize
- the size of the sliding windowConcurrentClockCuckooFilter
public static <T> ConcurrentClockCuckooFilter<T> create(com.google.common.hash.Funnel<? super T> funnel, long expectedInsertions, int bitsPerClock, int bitsPerSize, int bitsPerScope)
T
- the type of itemfunnel
- the funnel of T's that the constructed BloomFilter
will useexpectedInsertions
- the number of expected insertions to the constructed ConcurrentClockCuckooFilter
; must be positive; must be a power of 2bitsPerClock
- the number of bits the clock field hasbitsPerSize
- the number of bits the size field hasbitsPerScope
- the number of bits the scope field hasConcurrentClockCuckooFilter
public boolean put(T item, int size, CacheScope scopeInfo)
ClockCuckooFilter
put
in interface ClockCuckooFilter<T>
item
- the object to be insertedsize
- the size of this itemscopeInfo
- the scope this item belongs topublic boolean mightContainAndResetClock(T item)
ClockCuckooFilter
mightContainAndResetClock
in interface ClockCuckooFilter<T>
item
- the item to be checkedpublic boolean mightContain(T item)
ClockCuckooFilter
mightContain
in interface ClockCuckooFilter<T>
item
- the item to be checkedpublic boolean delete(T item)
ClockCuckooFilter
delete
in interface ClockCuckooFilter<T>
item
- the item to be deletedpublic void aging()
ClockCuckooFilter
aging
in interface ClockCuckooFilter<T>
public int getAge(T item)
item
- the item to be queriedpublic String getSummary()
public double expectedFpp()
expectedFpp
in interface ClockCuckooFilter<T>
true
for an object that has not actually been put in the ConcurrentCuckooFilter
.public long approximateElementCount()
approximateElementCount
in interface ClockCuckooFilter<T>
public long approximateElementCount(CacheScope scopeInfo)
approximateElementCount
in interface ClockCuckooFilter<T>
scopeInfo
- the scope to be queriedpublic long approximateElementSize()
approximateElementSize
in interface ClockCuckooFilter<T>
public long approximateElementSize(CacheScope scopeInfo)
approximateElementSize
in interface ClockCuckooFilter<T>
scopeInfo
- the scope to be queriedpublic void increaseOperationCount(int count)
count
- the number of operations have passedpublic int getNumBuckets()
public int getTagsPerBucket()
public int getBitsPerTag()
public int getBitsPerClock()
public int getBitsPerSize()
public int getBitsPerScope()
Copyright © 2023. All Rights Reserved.