guavabloom-filter

Guava BloomFilter how to expire once a day


I am using guava bloom filter to remove duplicate message in the service for receiving log. Is there a way for bloom filter to expire like guava cache does?


Solution

  • No, a BloomFilter does not have any remove functionality. This is also impossible, since a BloomFilter keeps track of what may possibly be in a set of objects.

    Removing an entry from a BloomFilter for one entry would result into false negatives for other entries. A BloomFilter must be 100% accurate about what is not in the set.