MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
ob_bloomfilter.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11#pragma once
12
13#include "common/lang/string.h"
14namespace oceanbase {
15
21{
22public:
29 ObBloomfilter(size_t hash_func_count = 4, size_t totoal_bits = 65536) {}
30
36 void insert(const string &object) {}
37
43 void clear() {}
44
51 bool contains(const string &object) const { return false; }
52
56 size_t object_count() const { return 0; }
57
62 bool empty() const { return 0 == object_count(); }
63
64private:
65};
66
67} // namespace oceanbase
A simple Bloom filter implementation(Need to support concurrency).
Definition: ob_bloomfilter.h:21
bool contains(const string &object) const
Checks if an object is possibly in the Bloom filter.
Definition: ob_bloomfilter.h:51
size_t object_count() const
Returns the count of objects inserted into the Bloom filter.
Definition: ob_bloomfilter.h:56
void insert(const string &object)
Inserts an object into the Bloom filter.
Definition: ob_bloomfilter.h:36
ObBloomfilter(size_t hash_func_count=4, size_t totoal_bits=65536)
Constructs a Bloom filter with specified parameters.
Definition: ob_bloomfilter.h:29
bool empty() const
Checks if the Bloom filter is empty.
Definition: ob_bloomfilter.h:62
void clear()
Clears all entries in the Bloom filter.
Definition: ob_bloomfilter.h:43