google / guava

Google core libraries for Java
Apache License 2.0
50.03k stars 10.86k forks source link

Document limits on size of BloomFilter #2366

Open haochun opened 8 years ago

haochun commented 8 years ago

i found the 19.0 add a new method for BloomFilter,i think i can put more elements into bloomFilter.but, when i try to put more than Integer.MAX_VALUE elemetns into it,it throws Exception:

Caused by: java.lang.IllegalArgumentException: Out of range: 3386879438068

i found the Exception occured this line:

public static int checkedCast(long value) { int result = (int) value; if (result != value) { // don't use checkArgument here, to avoid boxing throw new IllegalArgumentException("Out of range: " + value); } return result; }

so, why did you add this new Method?and,how can i put more elements into BloomFilter?

kevinb9n commented 8 years ago

Our implementation is still based on a single long[], so it can still only handle ~64*(MAX_VALUE-4) bits ... we need to make this clearer in the docs at the very least.