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/06/16 08:53:00 UTC

[jira] [Commented] (COLLECTIONS-819) BloomFilter: Remove methods only used in testing from IndexProducer

    [ https://issues.apache.org/jira/browse/COLLECTIONS-819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17554966#comment-17554966 ] 

Claude Warren commented on COLLECTIONS-819:
-------------------------------------------

When Bloom filters were originally proposed as an addition to collections, one of the first requests was to be able to take a list of index values and check if a Bloom filter contains them and to be able to create a bloom filter from such a list.  Both are possible as long as {{fromIndexArray}} is available.

If {{fromIndexArray}} is avalable then {{asIndexArray}} should be available for completeness.

> BloomFilter: Remove methods only used in testing from IndexProducer
> -------------------------------------------------------------------
>
>                 Key: COLLECTIONS-819
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-819
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Collection
>    Affects Versions: 4.5
>            Reporter: Claude Warren
>            Priority: Minor
>              Labels: bloom-filter
>
> [https://github.com/Claudenw/commons-collections/blob/9f2945cc98747893456b73f42ab53f46a866ac37/src/main/java/org/apache/commons/collections4/bloomfilter/IndexProducer.java#L50-L68]
>  
> h3. !https://avatars.githubusercontent.com/u/886334?s=48&v=4|width=24,height=24! *[aherbert|https://github.com/aherbert]* [on 27 Feb|https://github.com/apache/commons-collections/pull/258#discussion_r813449970]
> 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]
>  
> h3. !https://avatars.githubusercontent.com/u/886334?s=48&v=4|width=24,height=24! *[aherbert|https://github.com/aherbert]* [on 27 Feb|https://github.com/apache/commons-collections/pull/258#discussion_r813449970]
> 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.
> h3.  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)