You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Claude Warren (Jira)" <ji...@apache.org> on 2022/11/11 12:02:00 UTC
[jira] [Resolved] (COLLECTIONS-830) Add isEmpty() method to Hasher
[ https://issues.apache.org/jira/browse/COLLECTIONS-830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claude Warren resolved COLLECTIONS-830.
---------------------------------------
Resolution: Won't Fix
HasherCollection to be removed from code base.
> Add isEmpty() method to Hasher
> ------------------------------
>
> Key: COLLECTIONS-830
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-830
> Project: Commons Collections
> Issue Type: Improvement
> Components: Collection
> Affects Versions: 4.5
> Reporter: Claude Warren
> Assignee: Claude Warren
> Priority: Minor
> Labels: bloom-filter
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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
> {quote}{{boolean[] notEmpty = boolean[1];}}
> hasher.indices( shape ).forEachIndex( i ->\{notEmpty[0]=true;return false;});
> {quote}
> And then checking notEmpty[0].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)