A simple Bloom filter implementation(Need to support concurrency).
更多...
#include <ob_bloomfilter.h>
|
| | ObBloomfilter (size_t hash_func_count=4, size_t totoal_bits=65536) |
| | Constructs a Bloom filter with specified parameters. 更多...
|
| |
| void | insert (const string &object) |
| | Inserts an object into the Bloom filter. 更多...
|
| |
| void | clear () |
| | Clears all entries in the Bloom filter. 更多...
|
| |
| bool | contains (const string &object) const |
| | Checks if an object is possibly in the Bloom filter. 更多...
|
| |
|
size_t | object_count () const |
| | Returns the count of objects inserted into the Bloom filter.
|
| |
| bool | empty () const |
| | Checks if the Bloom filter is empty. 更多...
|
| |
A simple Bloom filter implementation(Need to support concurrency).
◆ ObBloomfilter()
| oceanbase::ObBloomfilter::ObBloomfilter |
( |
size_t |
hash_func_count = 4, |
|
|
size_t |
totoal_bits = 65536 |
|
) |
| |
|
inline |
Constructs a Bloom filter with specified parameters.
- 参数
-
| hash_func_count | Number of hash functions to use. Default is 4. |
| totoal_bits | Total number of bits in the Bloom filter. Default is 65536. |
◆ clear()
| void oceanbase::ObBloomfilter::clear |
( |
| ) |
|
|
inline |
Clears all entries in the Bloom filter.
Resets the filter, removing all previously inserted objects.
◆ contains()
| bool oceanbase::ObBloomfilter::contains |
( |
const string & |
object | ) |
const |
|
inline |
Checks if an object is possibly in the Bloom filter.
- 参数
-
| object | The object to be checked. |
- 返回
- true if the object might be in the filter, false if definitely not.
◆ empty()
| bool oceanbase::ObBloomfilter::empty |
( |
| ) |
const |
|
inline |
Checks if the Bloom filter is empty.
- 返回
- true if the filter is empty, false otherwise.
◆ insert()
| void oceanbase::ObBloomfilter::insert |
( |
const string & |
object | ) |
|
|
inline |
Inserts an object into the Bloom filter.
This method computes hash values for the given object and sets corresponding bits in the filter.
- 参数
-
| object | The object to be inserted. |
该类的文档由以下文件生成: