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

Thomas Mueller commented on OAK-10674:
--------------------------------------

[~reschke] best would be to move over 
org.apache.jackrabbit.oak.index.indexer.document.flatfile.analysis.utils.Hash 
as well. And then we can add a convenience methods:

{noformat}
    /**
     * Add an entry. This internally uses the hashCode() method to derive a
     * high-quality hash code.
     *
     * @param obj the object (must not be null)
     */
    public void add(@NotNull Object obj) {
        add(Hash.hash64(obj.hashCode()));
    }
    
    /**
     * Whether the entry may be in the set.
     * 
     * @param hash the hash value (need to be a high quality hash code, with all
     *             bits having high entropy)
     * @return true if the entry was added, or, with a certain false positive
     *         probability, even if it was not added
     */
    public boolean mayContain(@NotNull Object obj) {
        return mayContain(obj.hashCode());
    }
{noformat}



> DocumentStore: verify that we could use Oak's Bloom filter
> ----------------------------------------------------------
>
>                 Key: OAK-10674
>                 URL: https://issues.apache.org/jira/browse/OAK-10674
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: documentmk
>            Reporter: Julian Reschke
>            Priority: Major
>
> Test that we can use 
> oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/analysis/utils/BloomFilter.java
>  (for now, by copying it over).
> Then decide about where to move it, and whether API changes are desired.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to