MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
Represents a data block in the LSM-Tree. 更多...
#include <ob_block.h>
Public 成员函数 | |
ObBlock (const ObComparator *comparator) | |
void | add_offset (uint32_t offset) |
uint32_t | get_offset (int index) const |
string_view | get_entry (uint32_t offset) const |
int | size () const |
RC | decode (const string &data) |
Decodes serialized block data. 更多... | |
ObLsmIterator * | new_iterator () const |
Private 属性 | |
string | data_ |
vector< uint32_t > | offsets_ |
const ObComparator * | comparator_ |
Represents a data block in the LSM-Tree.
The ObBlock
class manages a block of serialized key-value pairs, along with their offsets, for efficient storage and retrieval. It provides methods to decode serialized data, access individual entries, and create iterators for traversing the block contents.
RC oceanbase::ObBlock::decode | ( | const string & | data | ) |
Decodes serialized block data.
This function parses and decodes the serialized string data to reconstruct the block's structure, including all key-value offsets and entries. The decoded data format can reference ObBlockBuilder.
data | The serialized block data as a string. |