MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
Build a SSTable 更多...
#include <ob_sstable_builder.h>
Public 成员函数 | |
ObSSTableBuilder (const ObComparator *comparator, ObLRUCache< uint64_t, shared_ptr< ObBlock > > *block_cache) | |
RC | build (shared_ptr< ObMemTable > mem_table, const string &file_name, uint32_t sst_id) |
Builds an SSTable from the provided in-memory table and stores it in a file. 更多... | |
size_t | file_size () const |
shared_ptr< ObSSTable > | get_built_table () |
void | reset () |
Private 成员函数 | |
void | finish_build_block () |
Private 属性 | |
const ObComparator * | comparator_ = nullptr |
ObBlockBuilder | block_builder_ |
string | curr_blk_first_key_ |
unique_ptr< ObFileWriter > | file_writer_ |
vector< BlockMeta > | block_metas_ |
uint32_t | curr_offset_ = 0 |
uint32_t | sst_id_ = 0 |
size_t | file_size_ = 0 |
ObLRUCache< uint64_t, shared_ptr< ObBlock > > * | block_cache_ = nullptr |
Build a SSTable
RC oceanbase::ObSSTableBuilder::build | ( | shared_ptr< ObMemTable > | mem_table, |
const string & | file_name, | ||
uint32_t | sst_id | ||
) |
Builds an SSTable from the provided in-memory table and stores it in a file.
This function takes an ObMemTable
as input, partitions the data into blocks, serializes the blocks, and writes them into an SSTable file.
mem_table | A shared pointer to the ObMemTable containing the data to be written into the SSTable. |
file_name | The name of the file where the constructed SSTable will be stored. |
sst_id | A unique identifier assigned to the created SSTable. |