gloomex v0.2.0 Gloomex

A fast and concurrent bloom filter.

It's goal is to emulate Guava bloom filter, mantaining the same behavior regarding false positives.

Link to this section Summary

Functions

Check if the element is in the bloom filter. Beware that this may be a false positive. There's no false negatives, i.e. if the result is false the element is not present.

Returns a plain Bloom filter based on the provided arguments

Returns a plain Bloom filter filled from each line in the file See &plain/3 for the options

Puts a new element in the bloom filter

Link to this section Types

Link to this section Functions

Link to this function

might_contain?(bloom, e)

Specs

might_contain?(t(), any()) :: boolean()

Check if the element is in the bloom filter. Beware that this may be a false positive. There's no false negatives, i.e. if the result is false the element is not present.

Link to this function

plain(expected_insertions, fpp, strategy \\ Gloomex.BloomFilterStrategy.Murmur128MITZ64)

Specs

Returns a plain Bloom filter based on the provided arguments:

  • expected_insertions, used to calculate the size of the bit array
  • fpp, the false positive probability
  • strategy, strategy implementing hash function

If a hash function is not provided then Murmur3_x64_128 will be used.

Link to this function

plain_from_file(file, fpp, strategy \\ Gloomex.BloomFilterStrategy.Murmur128MITZ64)

Specs

plain_from_file(String.t(), float(), Gloomex.BloomFilterStrategy.t()) :: t()

Returns a plain Bloom filter filled from each line in the file See &plain/3 for the options

Specs

put(t(), any()) :: t()

Puts a new element in the bloom filter