diff --git a/android/guava/src/com/google/common/hash/BloomFilter.java b/android/guava/src/com/google/common/hash/BloomFilter.java index 05138fb017bd..f4fcf1f74cbd 100644 --- a/android/guava/src/com/google/common/hash/BloomFilter.java +++ b/android/guava/src/com/google/common/hash/BloomFilter.java @@ -419,11 +419,19 @@ public int hashCode() { * ensuring proper serialization and deserialization, which is important since {@link #equals} * also relies on object identity of funnels. * + *
Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits. The number of bits required grows with {@code expectedInsertions}
+ * and as {@code fpp} approaches zero, so a sufficiently large {@code expectedInsertions} or small
+ * {@code fpp} will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @param fpp the desired false positive probability (must be positive and less than 1.0)
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries at the given {@code fpp} exceeds about {@code 64 *
+ * Integer.MAX_VALUE}
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits. The number of bits required grows with {@code expectedInsertions}
+ * and as {@code fpp} approaches zero, so a sufficiently large {@code expectedInsertions} or small
+ * {@code fpp} will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @param fpp the desired false positive probability (must be positive and less than 1.0)
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries at the given {@code fpp} exceeds about {@code 64 *
+ * Integer.MAX_VALUE}
* @since 19.0
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits, which at the default 3% false positive probability is reached at
+ * roughly {@code 2e10} {@code expectedInsertions}; a larger value will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries exceeds about {@code 64 * Integer.MAX_VALUE}
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits, which at the default 3% false positive probability is reached at
+ * roughly {@code 2e10} {@code expectedInsertions}; a larger value will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries exceeds about {@code 64 * Integer.MAX_VALUE}
* @since 19.0
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits. The number of bits required grows with {@code expectedInsertions}
+ * and as {@code fpp} approaches zero, so a sufficiently large {@code expectedInsertions} or small
+ * {@code fpp} will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @param fpp the desired false positive probability (must be positive and less than 1.0)
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries at the given {@code fpp} exceeds about {@code 64 *
+ * Integer.MAX_VALUE}
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits. The number of bits required grows with {@code expectedInsertions}
+ * and as {@code fpp} approaches zero, so a sufficiently large {@code expectedInsertions} or small
+ * {@code fpp} will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @param fpp the desired false positive probability (must be positive and less than 1.0)
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries at the given {@code fpp} exceeds about {@code 64 *
+ * Integer.MAX_VALUE}
* @since 19.0
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits, which at the default 3% false positive probability is reached at
+ * roughly {@code 2e10} {@code expectedInsertions}; a larger value will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries exceeds about {@code 64 * Integer.MAX_VALUE}
*/
public static Because a {@code BloomFilter} is backed by a single array, it can hold at most about {@code
+ * 64 * Integer.MAX_VALUE} bits, which at the default 3% false positive probability is reached at
+ * roughly {@code 2e10} {@code expectedInsertions}; a larger value will exceed this limit.
+ *
* @param funnel the funnel of T's that the constructed {@code BloomFilter} will use
* @param expectedInsertions the number of expected insertions to the constructed {@code
* BloomFilter}; must be positive
* @return a {@code BloomFilter}
+ * @throws IllegalArgumentException if the number of bits required to hold {@code
+ * expectedInsertions} entries exceeds about {@code 64 * Integer.MAX_VALUE}
* @since 19.0
*/
public static