Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
4.5
-
None
Description
The Hasher interface in the bloomfilter package does not have a way to determine if the hasher is empty. For the SimpleHasher implementation that is not an issue, however, the HasherCollection can be empty, and there is no guarantee that any other implementation of Hasher may have an empty state.
I have a use case where a Hasher is passed to a search method in a multidimensional Bloom filter. If the hasher is empty then we are doing the equivalent of a table scan in a database.
It is possible to determine if the hasher is not empty by something like
boolean[] notEmpty = boolean[1];
hasher.indices( shape ).forEachIndex( i ->{notEmpty[0]=true;return false;});
And then checking notEmpty[0].
Attachments
Issue Links
- is a child of
-
COLLECTIONS-728 BloomFilter contribution
-
- Resolved
-