Virginia Woolf
Virginia Woolf

Reputation: 1268

Guava BloomFilters: is there a limit for the number of expected insertions?

In this rather old thread here https://code.google.com/p/guava-libraries/issues/detail?id=1067, it is implied that the maximum number of expected insertions has to be smaller than Integer.MAX_VALUE. I expect to have approximately 20 billion insertions. Are the Guava BloomFilters reliable in this case?

Upvotes: 2

Views: 689

Answers (1)

Virginia Woolf
Virginia Woolf

Reputation: 1268

So the answer is yes, the limit is Integer.MAX_VALUE. The proposed solution is to use a fixed pool of bloom filters and first hash the item to select one of these bloom filters.

EDIT

So this has been recently fixed by the guava team starting with the 19.0-SNAPSHOT version. The limit is now Long.MAX_VALUE, although big expected insertions values in combination with small fpp values easily lead the VM to OOM errors.

Upvotes: 3

Related Questions