Skip to content

Commit

Permalink
pretty good doc on what the trees will look like when done
Browse files Browse the repository at this point in the history
  • Loading branch information
Cliff Moon committed May 16, 2010
1 parent 076fe3c commit b38b5a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/these_trees.mdown
Expand Up @@ -41,4 +41,17 @@ When luwak accepts a write it will generally come in one of two forms: either a
write W2
[ B1 ] [ B2 ] [ W1 ] [ W2 ]

<li>figure 3 - Appending write</li>
<li>figure 3 - Appending write</li>

After the blocks are written, the tree for the file is updated. The tree update at this point is handled in a similar manner to a normal b+ tree:

* do a search to determine what bucket the new record should go in
* if the bucket is not full, add the record.
* otherwise, split the bucket.
* allocate new leaf and move half the bucket's elements to the new bucket
* insert the new leaf's smallest key and address into the parent.
* if the parent is full, split it also
* now add the middle key to the parent node
* repeat until a parent is found that need not split
* if the root splits, create a new root which has one key and two pointers

0 comments on commit b38b5a3

Please sign in to comment.