Package com.redis.om.spring.ops.pds
Class BloomOperationsImpl<K>
java.lang.Object
com.redis.om.spring.ops.pds.BloomOperationsImpl<K>
- All Implemented Interfaces:
BloomOperations<K>
-
Constructor Summary
Constructors -
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
-
Constructor Details
-
BloomOperationsImpl
-
-
Method Details
-
createFilter
Description copied from interface:BloomOperationsReserve a bloom filter.- Specified by:
createFilterin interfaceBloomOperations<K>- 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
Description copied from interface:BloomOperationsAdds an item to the filter- Specified by:
addin interfaceBloomOperations<K>- 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
public List<Boolean> insert(K name, redis.clients.jedis.bloom.BFInsertParams options, String... items) Description copied from interface:BloomOperationsadd one or more items to the bloom filter, by default creating it if it does not yet exist- Specified by:
insertin interfaceBloomOperations<K>- Parameters:
name- The name of the filteroptions-BFInsertParamsitems- items to add to the filter- Returns:
- array of booleans, true for each succesful insertion
-
addMulti
Description copied from interface:BloomOperationsAdd one or more items to a filter- Specified by:
addMultiin interfaceBloomOperations<K>- 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
Description copied from interface:BloomOperationsCheck if an item exists in the filter- Specified by:
existsin interfaceBloomOperations<K>- 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
Description copied from interface:BloomOperationsCheck if one or more items exist in the filter- Specified by:
existsMultiin interfaceBloomOperations<K>- 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
Description copied from interface:BloomOperationsGet information about the filter- Specified by:
infoin interfaceBloomOperations<K>- Parameters:
name- the name of the filter- Returns:
- Return information
-