Stx-btree存储在磁盘上

stx-btree store on disc

本文关键字:磁盘 存储 Stx-btree      更新时间:2023-10-16

我正在开发一个小型数据库,我已经决定使用stx-btree实现将数据存储在btree中。

有可能在磁盘上存储stx-btree吗?

提前感谢!

UPDATE: I need hold in memory piece of btree, load/save required tree node .

我对c或c++甚至btree都知之甚少,但在复习时看到了这个问题,并在谷歌上搜索了一下,因为它看起来很有趣!…

看看这个gitHub页面:

https://github.com/fakechris/stx-btree-ondisk

--- Extensions ---
Beyond the usual STL interface the B+ tree classes support some extra goodies.
// Output the tree in a pseudo-hierarchical text dump to std::cout. This
// function requires that BTREE_DEBUG is defined prior to including the btree
// headers. Furthermore the key and data types must be std::ostream printable.
void print() const;
// Run extensive checks of the tree invariants. If a corruption in found the
// program will abort via assert(). See below on enabling auto-verification.
void verify() const;
// Serialize and restore the B+ tree nodes and data into/from a binary image.
// This requires that the key and data types are integral and contain no
// outside pointers or references.
void dump(std::ostream &os) const;
bool restore(std::istream &is);