Package org.redisson.api
Interface RBloomFilterAsync<T>
- Type Parameters:
T- - type of object
- All Superinterfaces:
RExpirableAsync,RObjectAsync
- All Known Subinterfaces:
RBloomFilter<T>
- All Known Implementing Classes:
RedissonBloomFilter
Distributed implementation of Bloom filter based on Highway 128-bit hash.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddAsync(Collection<T> elements) Adds elementsAdds elementcontainsAsync(Collection<T> elements) Checks for elements presencecontainsAsync(T object) Checks for element presenceCalculates probabilistic number of elements already added to Bloom filter.Returns expected amount of insertions per element.Returns false probability of element presence.Returns hash iterations amount used per element.Returns number of bits in Redis memory required by this instancetryInitAsync(long expectedInsertions, double falseProbability) Initializes Bloom filter params (size and hashIterations) calculated fromexpectedInsertionsandfalseProbabilityStores config to Redis server.Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
addAsync
Adds element- Parameters:
object- - element to add- Returns:
trueif element has been added successfullyfalseif element is already present
-
addAsync
Adds elements- Parameters:
elements- elements to add- Returns:
- number of added elements
-
containsAsync
Checks for element presence- Parameters:
object- element- Returns:
trueif element is presentfalseif element is not present
-
containsAsync
Checks for elements presence- Parameters:
elements- elements to check presence- Returns:
- number of elements present
-
tryInitAsync
Initializes Bloom filter params (size and hashIterations) calculated fromexpectedInsertionsandfalseProbabilityStores config to Redis server.- Parameters:
expectedInsertions- - expected amount of insertions per elementfalseProbability- - expected false probability- Returns:
trueif Bloom filter initializedfalseif Bloom filter already has been initialized
-
getExpectedInsertionsAsync
Returns expected amount of insertions per element. Calculated during bloom filter initialization.- Returns:
- expected amount of insertions per element
-
getFalseProbabilityAsync
Returns false probability of element presence. Calculated during bloom filter initialization.- Returns:
- false probability of element presence
-
getSizeAsync
Returns number of bits in Redis memory required by this instance- Returns:
- number of bits
-
getHashIterationsAsync
Returns hash iterations amount used per element. Calculated during bloom filter initialization.- Returns:
- hash iterations amount
-
countAsync
Calculates probabilistic number of elements already added to Bloom filter.- Returns:
- probabilistic number of elements
-