|
MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
BufferPool 的日志记录处理器 更多...
#include <buffer_pool_log.h>
Public 成员函数 | |
| BufferPoolLogHandler (DiskBufferPool &buffer_pool, LogHandler &log_handler) | |
| RC | allocate_page (PageNum page_num, LSN &lsn) |
| 分配一个页面 更多... | |
| RC | deallocate_page (PageNum page_num, LSN &lsn) |
| 释放一个页面 更多... | |
| RC | flush_page (Page &page) |
| 刷新页面到磁盘之前,需要保证页面对应的日志也已经刷新到磁盘 更多... | |
Private 成员函数 | |
| RC | append_log (BufferPoolOperation::Type type, PageNum page_num, LSN &lsn) |
Private 属性 | |
| DiskBufferPool & | buffer_pool_ |
| LogHandler & | log_handler_ |
BufferPool 的日志记录处理器
| RC BufferPoolLogHandler::allocate_page | ( | PageNum | page_num, |
| LSN & | lsn | ||
| ) |
分配一个页面
| page_num | 分配的页面号 | |
| [out] | lsn | 分配页面的日志序列号 |
| RC BufferPoolLogHandler::deallocate_page | ( | PageNum | page_num, |
| LSN & | lsn | ||
| ) |
释放一个页面
| page_num | 释放的页面编号 | |
| [out] | lsn | 释放页面的日志序列号 |
| RC BufferPoolLogHandler::flush_page | ( | Page & | page | ) |
刷新页面到磁盘之前,需要保证页面对应的日志也已经刷新到磁盘
如果页面刷新到磁盘了,但是日志很落后,在重启恢复时,就会出现异常,无法让所有的页面都恢复到一致的状态。