|
MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
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>
Public 成员函数 | |
| ObLsm (const ObLsm &)=delete | |
| ObLsm & | operator= (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 RC | remove (const string_view &key)=0 |
| Delete a key-value entry in the LSM-Tree. 更多... | |
| virtual ObLsmTransaction * | begin_transaction ()=0 |
| virtual ObLsmIterator * | new_iterator (ObLsmReadOptions options)=0 |
| Creates a new iterator for traversing the LSM-Tree database. 更多... | |
| virtual RC | batch_put (const vector< pair< string, string > > &kvs)=0 |
| Inserts a batch of key-value entries into the LSM-Tree. 更多... | |
| 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.
|
pure virtual |
Inserts a batch of key-value entries into the LSM-Tree.
| kvs | A vector of key-value pairs to insert. |
|
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 内被实现.
|
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.
| key | The key to look up. |
| value | Pointer to a string where the retrieved value will be stored. |
在 oceanbase::ObLsmImpl 内被实现.
|
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.
| options | Read options to configure the behavior of the iterator. |
在 oceanbase::ObLsmImpl 内被实现.
|
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.
| options | A reference to the LSM-Tree options configuration. |
| path | A string specifying the path to the database. |
| dbptr | A double pointer to store the allocated database instance. |
*dbptr) when done.
|
pure virtual |
Inserts or updates a key-value entry in the LSM-Tree.
This method adds a new entry
| key | The key to insert or update. |
| value | The value associated with the key. |
在 oceanbase::ObLsmImpl 内被实现.
|
pure virtual |
Delete a key-value entry in the LSM-Tree.
This method remove a entry
| key | The key to remove. |
在 oceanbase::ObLsmImpl 内被实现.