Update javadoc for ArrayCountingBloomFilter.

Document that no exception is raised when the filter state transitions
to invalid.
This commit is contained in:
Alex Herbert 2020-03-15 23:26:40 +00:00
parent 9de28a7b62
commit 7b15598da0
1 changed files with 13 additions and 10 deletions

View File

@ -29,17 +29,20 @@ import org.apache.commons.collections4.bloomfilter.hasher.StaticHasher;
/** /**
* A counting Bloom filter using an array to track counts for each enabled bit * A counting Bloom filter using an array to track counts for each enabled bit
* index. * index.
* *
* <p>Any operation that results in negative counts or integer overflow of counts will * <p>Any operation that results in negative counts or integer overflow of
* mark this filter as invalid. This transition is not reversible. The counts for the * counts will mark this filter as invalid. This transition is not reversible.
* filter immediately prior to the operation that create invalid counts can be recovered. * The operation is completed in full, no exception is raised and the state is
* See the documentation in {@link #isValid()} for details. * set to invalid. This allows the counts for the filter immediately prior to the
* * operation that created the invalid state to be recovered. See the documentation
* <p>All the operations in the filter assume the counts are currently valid. Behaviour * in {@link #isValid()} for details.
* of an invalid filter is undefined. It will no longer function identically to a standard *
* <p>All the operations in the filter assume the counts are currently valid,
* for example cardinality or contains operations. Behaviour of an invalid
* filter is undefined. It will no longer function identically to a standard
* Bloom filter that is the merge of all the Bloom filters that have been added * Bloom filter that is the merge of all the Bloom filters that have been added
* to and not later subtracted from the counting Bloom filter. * to and not later subtracted from the counting Bloom filter.
* *
* <p>The maximum supported number of items that can be stored in the filter is * <p>The maximum supported number of items that can be stored in the filter is
* limited by the maximum array size combined with the {@link Shape}. For * limited by the maximum array size combined with the {@link Shape}. For
* example an implementation using a {@link Shape} with a false-positive * example an implementation using a {@link Shape} with a false-positive
@ -47,8 +50,8 @@ import org.apache.commons.collections4.bloomfilter.hasher.StaticHasher;
* approximately 75 million items using 20 hash functions per item with a memory * approximately 75 million items using 20 hash functions per item with a memory
* consumption of approximately 8 GB. * consumption of approximately 8 GB.
* *
* @since 4.5
* @see Shape * @see Shape
* @since 4.5
*/ */
public class ArrayCountingBloomFilter extends AbstractBloomFilter implements CountingBloomFilter { public class ArrayCountingBloomFilter extends AbstractBloomFilter implements CountingBloomFilter {