MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
oceanbase::ObBloomfilter类 参考

A simple Bloom filter implementation(Need to support concurrency). 更多...

#include <ob_bloomfilter.h>

Public 成员函数

 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_countNumber of hash functions to use. Default is 4.
totoal_bitsTotal 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.

参数
objectThe 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.

参数
objectThe object to be inserted.

该类的文档由以下文件生成: