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

BloomFilter: Remove methods only used in testing from IndexProducer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.5.0-M1
    • None
    • Collection

    Description

      https://github.com/Claudenw/commons-collections/blob/9f2945cc98747893456b73f42ab53f46a866ac37/src/main/java/org/apache/commons/collections4/bloomfilter/IndexProducer.java#L50-L68

       

      aherbert on 27 Feb

      This method is only used in testing. What is the use case? Note that BloomFilter interface cannot merge an IndexProducer. This functionality is only provided by the constructors for SimpleBloomFilter and SparseBloomFitler. The method is trivially implemented if a user did want to populate a Bloom filter with certain indices. But I do not see why they would unless deserialising its stored representation. Given that we are not supporting any such constructors for the ArrayCountingBloomFilter (creating and populating at the same time) this seems like a partial support in the library. Either the serialisation and deserialisation is better supported, or we drop these methods from the public API for now.

       

       

      https://github.com/Claudenw/commons-collections/blob/9f2945cc98747893456b73f42ab53f46a866ac37/src/main/java/org/apache/commons/collections4/bloomfilter/IndexProducer.java#L104-L119

       

      aherbert on 27 Feb

      This method is only used in testing. It is not required for any other functionality in the API. What is the use case? If this is for serialisation then the method is trivially performed anyway and the decision should be made to use this or the bitmap long[] representation depending on the saturation of the filter. It would be simpler to drop this method.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              claude Claude Warren
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: