I am looking for a thread-safe BloomFilter implementation, i.e., an implementation that will behave exactly the same if values are put into the filter in sequence or simultaneously in parallel. The javadoc for guava's BloomFilter is silent about thread-safety. Is it thread-safe?
Guava's BloomFilter isn't thread-safe.
That said, it's not 100% clear to me what semantics you'd expect for a thread-safe BloomFilter -- would put be atomic? I'm imagining the effects of replacing the long[] with an AtomicLongArray, and I'm pretty sure the semantics you end up with are "if put(x) happens-before mightContain(x), then mightContain(x) returns true," and I think those semantics are useful, but I'm not positive.
This might be worth filing an issue with a specific use case, but there would be some details to work out about what thread-safety would mean here, exactly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With