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?
I am looking for a thread-safe BloomFilter implementation, i.e., an implementation that will behave
Share
Guava’s
BloomFilterisn’t thread-safe.That said, it’s not 100% clear to me what semantics you’d expect for a thread-safe
BloomFilter— wouldputbe atomic? I’m imagining the effects of replacing thelong[]with anAtomicLongArray, and I’m pretty sure the semantics you end up with are “ifput(x)happens-beforemightContain(x), thenmightContain(x)returnstrue,” 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.