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

ObLsm is a key-value storage engine for educational purpose. ObLsm learned a lot about design from leveldb and streamlined it. TODO: add more comments about ObLsm. 更多...

#include <ob_lsm.h>

类 oceanbase::ObLsm 继承关系图:
oceanbase::ObLsmImpl

Public 成员函数

 ObLsm (const ObLsm &)=delete
 
ObLsmoperator= (const ObLsm &)=delete
 
virtual RC put (const string_view &key, const string_view &value)=0
 Inserts or updates a key-value entry in the LSM-Tree. 更多...
 
virtual RC get (const string_view &key, string *value)=0
 Retrieves the value associated with a specified key. 更多...
 
virtual ObLsmIteratornew_iterator (ObLsmReadOptions options)=0
 Creates a new iterator for traversing the LSM-Tree database. 更多...
 
virtual void dump_sstables ()=0
 Dumps all SSTables for debugging purposes. 更多...
 

静态 Public 成员函数

static RC open (const ObLsmOptions &options, const string &path, ObLsm **dbptr)
 Opens an LSM-Tree database at the specified path. 更多...
 

详细描述

ObLsm is a key-value storage engine for educational purpose. ObLsm learned a lot about design from leveldb and streamlined it. TODO: add more comments about ObLsm.

成员函数说明

◆ dump_sstables()

virtual void oceanbase::ObLsm::dump_sstables ( )
pure virtual

Dumps all SSTables for debugging purposes.

This method outputs the structure and contents of all SSTables in the LSM-Tree for debugging or inspection purposes.

oceanbase::ObLsmImpl 内被实现.

◆ get()

virtual RC oceanbase::ObLsm::get ( const string_view &  key,
string *  value 
)
pure virtual

Retrieves the value associated with a specified key.

This method looks up the value corresponding to the given key in the LSM-Tree. If the key exists, the value is stored in the output parameter *value.

参数
keyThe key to look up.
valuePointer to a string where the retrieved value will be stored.
返回
An RC value indicating success or failure of the operation.

oceanbase::ObLsmImpl 内被实现.

◆ new_iterator()

virtual ObLsmIterator * oceanbase::ObLsm::new_iterator ( ObLsmReadOptions  options)
pure virtual

Creates a new iterator for traversing the LSM-Tree database.

This method returns a heap-allocated iterator over the contents of the database. The iterator is initially invalid, and the caller must use one of the seek/seek_to_first/seek_to_last methods on the iterator before accessing any elements.

参数
optionsRead options to configure the behavior of the iterator.
返回
A pointer to the newly created iterator.
注解
The caller is responsible for deleting the iterator when it is no longer needed.

oceanbase::ObLsmImpl 内被实现.

◆ open()

RC oceanbase::ObLsm::open ( const ObLsmOptions options,
const string &  path,
ObLsm **  dbptr 
)
static

Opens an LSM-Tree database at the specified path.

This is a static method that initializes an LSM-Tree database instance. It allocates memory for the database and returns a pointer to it through the dbptr parameter. The caller is responsible for freeing the memory allocated for the database by deleting the returned pointer when it is no longer needed.

参数
optionsA reference to the LSM-Tree options configuration.
pathA string specifying the path to the database.
dbptrA double pointer to store the allocated database instance.
返回
An RC value indicating success or failure of the operation.
注解
The caller must delete the returned database pointer (*dbptr) when done.

◆ put()

virtual RC oceanbase::ObLsm::put ( const string_view &  key,
const string_view &  value 
)
pure virtual

Inserts or updates a key-value entry in the LSM-Tree.

This method adds a new entry

参数
keyThe key to insert or update.
valueThe value associated with the key.
返回
An RC value indicating success or failure of the operation.

oceanbase::ObLsmImpl 内被实现.


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