17#include "common/sys/rc.h"
18#include "common/types.h"
19#include "common/lang/string.h"
20#include "common/lang/unordered_map.h"
21#include "storage/record/record.h"
22#include "storage/clog/log_replayer.h"
51 Type type()
const {
return type_; }
52 int32_t index()
const {
return static_cast<int32_t
>(type_); }
54 string to_string()
const;
71 string to_string()
const;
87 string to_string()
const;
100 static const int32_t SIZE;
102 string to_string()
const;
129 RC
commit(int32_t trx_id, int32_t commit_trx_id);
163 unordered_map<int32_t, MvccTrx *> trx_map_;
一个DB实例负责管理一批表
Definition: db.h:46
描述一条日志
Definition: log_entry.h:44
对外提供服务的CLog模块
Definition: log_handler.h:40
日志回放接口类
Definition: log_replayer.h:26
Definition: mvcc_trx.h:26
处理事务日志的辅助类
Definition: mvcc_trx_log.h:110
RC delete_record(int32_t trx_id, Table *table, const RID &rid)
记录删除一条记录的日志
Definition: mvcc_trx_log.cpp:86
RC rollback(int32_t trx_id)
记录回滚事务的日志
Definition: mvcc_trx_log.cpp:122
RC insert_record(int32_t trx_id, Table *table, const RID &rid)
记录插入一条记录的日志
Definition: mvcc_trx_log.cpp:71
RC commit(int32_t trx_id, int32_t commit_trx_id)
记录提交事务的日志
Definition: mvcc_trx_log.cpp:101
表示各种操作类型
Definition: mvcc_trx_log.h:36
Type
Definition: mvcc_trx_log.h:39
事务日志回放器
Definition: mvcc_trx_log.h:146
Db & db_
所属数据库
Definition: mvcc_trx_log.h:158
RC on_done() override
当所有日志回放完成时的回调函数
Definition: mvcc_trx_log.cpp:177
RC replay(const LogEntry &entry) override
回放一条日志
Definition: mvcc_trx_log.cpp:140
MvccTrxKit & trx_kit_
事务管理器
Definition: mvcc_trx_log.h:159
LogHandler & log_handler_
日志处理器
Definition: mvcc_trx_log.h:160
多版本并发事务TODO 没有垃圾回收
Definition: mvcc_trx.h:63
事务提交的日志
Definition: mvcc_trx_log.h:96
int32_t commit_trx_id
提交的事务ID
Definition: mvcc_trx_log.h:98
MvccTrxLogHeader header
日志头部
Definition: mvcc_trx_log.h:97
表示事务日志中操作行数据的日志,比如插入和删除
Definition: mvcc_trx_log.h:80
int32_t table_id
表ID
Definition: mvcc_trx_log.h:82
MvccTrxLogHeader header
日志头部
Definition: mvcc_trx_log.h:81
RID rid
记录ID
Definition: mvcc_trx_log.h:83
static const int32_t SIZE
日志大小
Definition: mvcc_trx_log.h:85
标识一个记录的位置 一个记录是放在某个文件的某个页面的某个槽位。这里不记录文件信息,记录页面和槽位信息
Definition: record.h:35