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

叶子节点的操作 更多...

#include <bplus_tree.h>

类 LeafIndexNodeHandler 继承关系图:
IndexNodeHandler

Public 成员函数

 LeafIndexNodeHandler (BplusTreeMiniTransaction &mtr, const IndexFileHeader &header, Frame *frame)
 
RC init_empty ()
 
RC set_next_page (PageNum page_num)
 
PageNum next_page () const
 
char * key_at (int index)
 
char * value_at (int index)
 
int lookup (const KeyComparator &comparator, const char *key, bool *found=nullptr) const
 
RC insert (int index, const char *key, const char *value)
 
RC remove (int index)
 
int remove (const char *key, const KeyComparator &comparator)
 
RC move_half_to (LeafIndexNodeHandler &other)
 
RC move_first_to_end (LeafIndexNodeHandler &other)
 
RC move_last_to_front (LeafIndexNodeHandler &other)
 
RC move_to (LeafIndexNodeHandler &other)
 
bool validate (const KeyComparator &comparator, DiskBufferPool *bp) const
 
- Public 成员函数 继承自 IndexNodeHandler
 IndexNodeHandler (BplusTreeMiniTransaction &mtr, const IndexFileHeader &header, Frame *frame)
 
void init_empty (bool leaf)
 初始化一个新的页面 更多...
 
bool is_leaf () const
 是否叶子节点
 
virtual int key_size () const
 存储的键值大小
 
virtual int value_size () const
 存储的值的大小。内部节点和叶子节点是不一样的,但是这里返回的是叶子节点存储的大小 更多...
 
virtual int item_size () const
 存储的键值对的大小。值是指叶子节点中存放的数据 更多...
 
void increase_size (int n)
 
int size () const
 
int max_size () const
 
int min_size () const
 
RC set_parent_page_num (PageNum page_num)
 
PageNum parent_page_num () const
 
PageNum page_num () const
 
bool is_safe (BplusTreeOperationType op, bool is_root_node)
 判断对指定的操作,是否安全的 更多...
 
bool validate () const
 验证当前节点是否有问题
 
Frameframe () const
 
RC recover_insert_items (int index, const char *items, int num)
 
RC recover_remove_items (int index, int num)
 

Protected 成员函数

char * __item_at (int index) const override
 获取指定元素的开始内存位置 更多...
 
RC append (const char *items, int num)
 
RC append (const char *item)
 
RC preappend (const char *item)
 
- Protected 成员函数 继承自 IndexNodeHandler
virtual char * __item_at (int index) const
 获取指定元素的开始内存位置 更多...
 
char * __key_at (int index) const
 
char * __value_at (int index) const
 

Private 属性

LeafIndexNodeleaf_node_ = nullptr
 

友元

string to_string (const LeafIndexNodeHandler &handler, const KeyPrinter &printer)
 

额外继承的成员函数

- Protected 属性 继承自 IndexNodeHandler
BplusTreeMiniTransactionmtr_
 
const IndexFileHeaderheader_
 
Frameframe_ = nullptr
 
IndexNodenode_ = nullptr
 

详细描述

叶子节点的操作

成员函数说明

◆ __item_at()

char * LeafIndexNodeHandler::__item_at ( int  index) const
overrideprotectedvirtual

获取指定元素的开始内存位置

注解
这并不是一个纯虚函数,是为了可以直接使用 IndexNodeHandler 类。 但是使用这个类时,注意不能使用与这个函数相关的函数。

重载 IndexNodeHandler .

◆ lookup()

int LeafIndexNodeHandler::lookup ( const KeyComparator comparator,
const char *  key,
bool *  found = nullptr 
) const

查找指定key的插入位置(注意不是key本身) 如果key已经存在,会设置found的值。

◆ move_to()

RC LeafIndexNodeHandler::move_to ( LeafIndexNodeHandler other)

move all items to left page


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