Package com.redis.om.spring.ops.pds
Interface BloomOperations<K>
- All Known Implementing Classes:
BloomOperationsImpl
public interface BloomOperations<K>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an item to the filterAdd one or more items to a filtervoidcreateFilter(K name, long initCapacity, double errorRate) Reserve a bloom filter.booleanCheck if an item exists in the filterexistsMulti(K name, String... values) Check if one or more items exist in the filterGet information about the filteradd one or more items to the bloom filter, by default creating it if it does not yet exist
-
Method Details
-
createFilter
Reserve a bloom filter.- Parameters:
name- The key of the filterinitCapacity- Optimize for this many itemserrorRate- The desired rate of false positives Note that if a filter is not reserved, a new one is created when is called.
-
add
Adds an item to the filter- Parameters:
name- The name of the filtervalue- The value to add to the filter- Returns:
- true if the item was not previously in the filter.
-
insert
add one or more items to the bloom filter, by default creating it if it does not yet exist- Parameters:
name- The name of the filteroptions-BFInsertParamsitems- items to add to the filter- Returns:
- array of booleans, true for each succesful insertion
-
addMulti
Add one or more items to a filter- Parameters:
name- Name of the filtervalues- values to add to the filter.- Returns:
- An array of booleans of the same length as the number of values. Each boolean values indicates whether the corresponding element was previously in the filter or not. A true value means the item did not previously exist, whereas a false value means it may have previously existed.
-
exists
Check if an item exists in the filter- Parameters:
name- Name (key) of the filtervalue- Value to check for- Returns:
- true if the item may exist in the filter, false if the item does not exist in the filter
-
existsMulti
Check if one or more items exist in the filter- Parameters:
name- Name of the filter to checkvalues- values to check for- Returns:
- An array of booleans. A true value means the corresponding value may exist, false means it does not exist
-
info
Get information about the filter- Parameters:
name- the name of the filter- Returns:
- Return information
-