Physical pagesPage edited by Emmanuel LécharnyChanges (4)
Full ContentThe RecordManager stores all the Btrees in one single file, which is split in many physical pages, all having the same size.
If we except a small header at the beginning of the file, everything is stored in PageIO in the file. PageIOa PageIO contains some raw data. As we have to map some logical data that may be wider than a physical fixed size PageIO, we link the PageIO so that they contain all the data contained in a logical page. Each PageIO has a hight byte pointer at the beginning, plus an extra 4 bytes on the first PageIO to define the number of bytes stored. Here is the mapping between a logical page and some PageIO : Every PageIO are contiguous on disk. RecordManager headerWe keep a few bytes at the beginning of the file to store some critical information about the RecordManager Here is the list of stored informations :
Here is a picture that shows the header content : We keep a track of the free pages (a free page is a PageIO that is not anymore used, for instance because the data have been deleted.) This is done by keeping a link between each PageIO and by pointing to the first feee PageIO and to the last free PageIO At startup, of course, we have no free pages, and those pointers contain the -1 offset. The internal structureThe RecordManager manages BTrees, and we have to store them into PageIOs. How do we do that ? All the BTrees have a header that contains many informations about them, and point to a rootPage which is the current root (so the root for the latest revision). As a RecordManager can manage more than one BTree, we have to find a way to retreive all the BTrees at startup : we use an internal link, so that a btree points to the next btree. At startup, we read the first BTree which is stored in the first PageIO in the file (so just after the RecordManager header), then we read the next btree pointed by the first btree, and so on. The BTree headerEach BTree has to keep many informations so that it can be used. Those informations are :
Here is a diagram which present this data structure on disk : Note that a BTree header can be stored on one or many IOPages, depending on its size. The Nodes and LeavesNodes and Leaves are logical BTree pages which are serialized on disk into one to many PageIOs. They have slightly different data structures, as Nodes contains pointers to leaves, and no data, while Leaves contains data. On disk, each Node and Leaf are stored in PageIOs, as we said. A Node will have pointers to some other logical pages, and on disk, those pointers will be offset of the first PageIO used to store the logical page it points to. Here is the Node data structure once serialized : Unable to render embedded object: File (node.png) not found. Here is the Leaf data structure once serialized : Unable to render embedded object: File (leaf.png) not found. The rootPage is just a Node or a Leaf.
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages confluence
- [CONF] Apache Labs > Physical pages Confluence
- [CONF] Apache Labs > Physical pages Confluence
- [CONF] Apache Labs > Physical pages Confluence
- [CONF] Apache Labs > Physical pages Confluence
- [CONF] Apache Labs > Physical pages Confluence
- [CONF] Apache Labs > Physical pages Confluence
