13#include "common/lang/memory.h"
14#include "oblsm/table/ob_block_builder.h"
15#include "oblsm/memtable/ob_memtable.h"
16#include "common/lang/string.h"
17#include "oblsm/util/ob_file_writer.h"
18#include "oblsm/table/ob_block.h"
19#include "oblsm/table/ob_sstable.h"
20#include "oblsm/util/ob_lru_cache.h"
31 : comparator_(comparator), block_cache_(block_cache)
48 RC
build(shared_ptr<ObMemTable> mem_table,
const string &file_name, uint32_t sst_id);
49 size_t file_size()
const {
return file_size_; }
50 shared_ptr<ObSSTable> get_built_table();
54 void finish_build_block();
58 string curr_blk_first_key_;
59 unique_ptr<ObFileWriter> file_writer_;
60 vector<BlockMeta> block_metas_;
61 uint32_t curr_offset_ = 0;
63 size_t file_size_ = 0;
Build a ObBlock in SSTable
Definition: ob_block_builder.h:24
base class of all comparators
Definition: ob_comparator.h:21
A thread-safe implementation of an LRU (Least Recently Used) cache.
Definition: ob_lru_cache.h:31
Build a SSTable
Definition: ob_sstable_builder.h:28
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.
Definition: ob_sstable_builder.cpp:17