Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-830

Add isEmpty() method to Hasher

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.5
    • None
    • Collection

    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            claude Claude Warren
            claude Claude Warren

            Dates

              Created:
              Updated:

              Slack

                Issue deployment