1#ifndef STORAGE_BLOOM_FILTER_H
2#define STORAGE_BLOOM_FILTER_H
4#include <vkdb/murmur_hash_3.h>
5#include <vkdb/time_series_key.h>
6#include <vkdb/random.h>
19 using size_type = uint64_t;
58 uint64_t expected_no_of_elems,
59 double false_positive_rate
113 [[nodiscard]]
std::
string str() const noexcept;
120 using HashValue = uint32_t;
127 void initialise_seeds(size_type no_of_hashes) noexcept;
136 [[nodiscard]] HashValue hash(
145 std::vector<size_type> seeds_;
151 std::vector<
bool> bits_;
Bloom filter for time series keys.
std::string str() const noexcept
Get the string representation of the Bloom filter.
BloomFilter()=delete
Deleted default constructor.
~BloomFilter() noexcept=default
Destroy the BloomFilter object.
bool mayContain(const key_type &key) const noexcept
Check if the Bloom filter may contain a key.
void insert(const key_type &key) noexcept
Insert a key into the Bloom filter.
static constexpr double MIN_FALSE_POSITIVE_RATE
Minimum (exclusive) false positive rate.
static constexpr double MAX_FALSE_POSITIVE_RATE
Maximum (exclusive) false positive rate.
Represents a key in vkdb.