Skip to main content

NewOppoBloomFilter

Creates a new Opposite of Bloom filter as proposed in the linked GitHub repository and blog post. It initializes the filter with a specified size, rounding it up to the next largest power of two, and returns an OppoBloomFilter instance along with any errors encountered during initialization.

def NewOppoBloomFilter(
size: int,
scope: promutils.Scope
) - > *OppoBloomFilter, error

Creates a new Opposite of Bloom filter proposed in https://github.com/jmhodges/opposite_of_a_bloom_filter/ and the related blog https://www.somethingsimilar.com/2012/05/21/the-opposite-of-a-bloom-filter/

Parameters

NameTypeDescription
sizeintThe desired capacity of the filter. This value will be rounded up to the next largest power of two.
scopepromutils.ScopeThe Prometheus scope for metrics collection within the filter.

Returns

TypeDescription
*OppoBloomFilter, errorA new OppoBloomFilter instance or an error if the size is invalid.