MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
Public 成员函数 | Private 成员函数 | Private 属性 | 所有成员列表
BufferPoolLogHandler类 参考final

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 属性

DiskBufferPoolbuffer_pool_
 
LogHandlerlog_handler_
 

详细描述

BufferPool 的日志记录处理器

成员函数说明

◆ allocate_page()

RC BufferPoolLogHandler::allocate_page ( PageNum  page_num,
LSN &  lsn 
)

分配一个页面

参数
page_num分配的页面号
[out]lsn分配页面的日志序列号
注解
TODO 可以把frame传过来,记录完日志,直接更新页面的lsn

◆ deallocate_page()

RC BufferPoolLogHandler::deallocate_page ( PageNum  page_num,
LSN &  lsn 
)

释放一个页面

参数
page_num释放的页面编号
[out]lsn释放页面的日志序列号

◆ flush_page()

RC BufferPoolLogHandler::flush_page ( Page page)

刷新页面到磁盘之前,需要保证页面对应的日志也已经刷新到磁盘

如果页面刷新到磁盘了,但是日志很落后,在重启恢复时,就会出现异常,无法让所有的页面都恢复到一致的状态。


该类的文档由以下文件生成: