19#include "common/types.h"
20#include "common/sys/rc.h"
21#include "common/lang/span.h"
22#include "common/lang/memory.h"
23#include "common/lang/vector.h"
24#include "common/lang/string.h"
25#include "storage/index/latch_memo.h"
26#include "storage/clog/log_replayer.h"
119 IndexNodeHandler &node_handler, PageNum first_page_num, span<const char> key, PageNum page_num);
152 RC append_log_entry(unique_ptr<bplus_tree::LogEntryHandler> entry);
156 int32_t buffer_pool_id_ = -1;
158 vector<unique_ptr<bplus_tree::LogEntryHandler>>
entries_;
180 LatchMemo &latch_memo() {
return latch_memo_; }
188 RC *operation_result_ =
nullptr;
B+树的实现
Definition: bplus_tree.h:450
B+树日志重做器
Definition: bplus_tree_log.h:198
virtual RC replay(const LogEntry &entry) override
回放一条日志
Definition: bplus_tree_log.cpp:292
B+树日志记录辅助类,同时可以利用此类做回滚操作
Definition: bplus_tree_log.h:62
RC set_parent_page(IndexNodeHandler &node_handler, PageNum page_num, PageNum old_page_num)
修改某个页面的父节点编号
Definition: bplus_tree_log.cpp:88
RC node_remove_items(IndexNodeHandler &node_handler, int index, span< const char > items, int item_num)
在某个页面中删除一些元素
Definition: bplus_tree_log.cpp:59
RC commit()
提交。表示整个操作成功
Definition: bplus_tree_log.cpp:103
RC update_root_page(Frame *frame, PageNum root_page_num, PageNum old_page_num)
更新B+树文件头页,也就是指向根页的页面编号
Definition: bplus_tree_log.cpp:43
RC internal_init_empty(IndexNodeHandler &node_handler)
初始化一个空的内部节点
Definition: bplus_tree_log.cpp:70
RC leaf_init_empty(IndexNodeHandler &node_handler)
初始化一个空的叶子节点
Definition: bplus_tree_log.cpp:48
RC rollback(BplusTreeMiniTransaction &mtr, BplusTreeHandler &tree_handler)
回滚。操作执行一半失败了,把所有操作都回滚回来
Definition: bplus_tree_log.cpp:133
RC init_header_page(Frame *frame, const IndexFileHeader &header)
初始化B+树文件头页
Definition: bplus_tree_log.cpp:38
bool need_log_
当前记录了的日志
Definition: bplus_tree_log.h:160
RC leaf_set_next_page(IndexNodeHandler &node_handler, PageNum page_num, PageNum old_page_num)
修改叶子节点的下一个兄弟节点编号
Definition: bplus_tree_log.cpp:65
static string log_entry_to_string(const LogEntry &entry)
日志记录转字符串
Definition: bplus_tree_log.cpp:235
RC internal_update_key(IndexNodeHandler &node_handler, int index, span< const char > key, span< const char > old_key)
更新某个内部页面上,更新指定位置的键值
Definition: bplus_tree_log.cpp:82
vector< unique_ptr< bplus_tree::LogEntryHandler > > entries_
关联的缓冲池ID
Definition: bplus_tree_log.h:158
RC internal_create_new_root(IndexNodeHandler &node_handler, PageNum first_page_num, span< const char > key, PageNum page_num)
创建一个新的根节点
Definition: bplus_tree_log.cpp:75
RC node_insert_items(IndexNodeHandler &node_handler, int index, span< const char > items, int item_num)
在某个页面中插入一些元素
Definition: bplus_tree_log.cpp:53
static RC redo(BufferPoolManager &bpm, const LogEntry &entry)
重做日志。通常在系统启动时,会把所有日志重做一遍
Definition: bplus_tree_log.cpp:147
B+树使用的事务辅助类
Definition: bplus_tree_log.h:170
BufferPool的管理类
Definition: disk_buffer_pool.h:322
IndexNode 仅作为数据在内存或磁盘中的表示IndexNodeHandler 负责对IndexNode做各种操作。 作为一个类来说,虚函数会影响“结构体”真实的内存布局,所以将数据存储与操作分开
Definition: bplus_tree.h:267
Definition: latch_memo.h:52
描述一条日志
Definition: log_entry.h:44
对外提供服务的CLog模块
Definition: log_handler.h:40
日志回放接口类
Definition: log_replayer.h:26
反序列化工具
Definition: serializer.h:63