Skip to content

Commit

Permalink
add mmaped b+ tree (#207)
Browse files Browse the repository at this point in the history
This PR adds a custom mmaped B+ tree. This data structure creates a mapping from uint64 to uint64.

Structure of node:
Each node in the node is of size pageSize. Two kinds of nodes. Leaf nodes and internal nodes.
Leaf nodes only contain the data. Internal nodes would contain the key and the offset to the child node.
Internal node would have first entry as:
<0 offset to child>, <1000 offset>, <5000 offset>, and so on...
Leaf nodes would just have: <key, value>, <key, value>, and so on...
Last 16 bytes of the node are off limits.
| pageID (8 bytes) | metaBits (1 byte) | 3 free bytes | numKeys (4 bytes) |
  • Loading branch information
NamanJain8 authored Oct 22, 2020
1 parent f32a016 commit 1d4870a
Show file tree
Hide file tree
Showing 2 changed files with 665 additions and 0 deletions.
Loading

0 comments on commit 1d4870a

Please sign in to comment.