eclipse / eclipse-collections

Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.
https://eclipse.dev/collections/
2.42k stars 604 forks source link

Introduce a Bloom Filter implementation #1114

Open gastaldi opened 3 years ago

gastaldi commented 3 years ago

A Bloom filter offers an approximate containment test with one-sided error: if it claims that an element is contained in it, this might be in error, but if it claims that an element is not contained in it, then this is definitely true.

This may be useful for scenarios where you have a cache map but don't want to store empty values.

Here is a tutorial explaining how it works: http://llimllib.github.io/bloomfilter-tutorial There is an implementation in Guava: https://github.com/google/guava/blob/master/guava/src/com/google/common/hash/BloomFilter.java

And here is a nice explanation on how it works: https://www.geeksforgeeks.org/bloom-filter-in-java-with-examples/

kevinb9n commented 2 years ago

If you decide to do something on this, ask me and I can dig up what our regrets are with Guava's. We can't change it now so.... :-)