Skip to content

Kampbell/bt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bt

COW b-trees

This repository implements the COW friendly b-trees, as described in the paper: Ohad Rodeh B-trees, Shadows, and Clones ACM Transactions on Storage 2008

The code contains a lot of scaffolding, but the main directory is src/oc/bpt. BPT is short for "B Plus Tree". The license is BSD, which should allow incorporating the code into other open source and commercial projects.

Directory naming

The src directory contains these sub-directories:

oc      object code
oc/bpt  b-tree
oc/crt  thread and lock support, based on pthreads
oc/ds   data structures
oc/utl  utilities
oc/xt   extent tree
pl      platform

The locking and thread support is currently based on Linux pthreads. The name "crt" is due to an internal co-routine library that was used prior to this, and never released.

B-tree implementation

Directory oc/bpt holds the core b-tree code, the files are as follows:

oc_bpt_int.h          main interface file
oc_bpt_label.[ch]     labeling b-tree nodes, for debugging 
oc_bpt_nd.[ch]        structure of a b-tree node (page)
oc_bpt_op_insert.[ch] insert key algorithm
oc_bpt_op_insert_range.[ch] insert a key range algorithm
oc_bpt_op_lookup.[ch] key lookup algorithm
oc_bpt_op_output_dot.[ch]
oc_bpt_op_output_clones_dot.[ch]  generate output file in dot format
oc_bpt_op_remove_key.[ch] remove key algorithm
oc_bpt_op_remove_range.[ch] remove a key range algorithm
oc_bpt_op_stat.[ch]
oc_bpt_op_validate.[ch] validate a btree, for debugging
oc_bpt_op_validate_clones.[ch] validate a btree, for debugging

The most complicated algorithm remove-range, the main issue is that removing a range from the middle of a tree causes significant difficulties when trying to rebalance it. The output-dot files are used to generate b-tree descriptions in dot format (http://www.graphviz.org/). This allows using the dot program to visualize test outputs, for example: dot -Tjpg X.dot -o X.jpg

The Oc_wu structure that is passed around by the code, describe a "work-unit". This is probably equivalent to a transaction in the caller code.

TODO

Revive the XT multi-threaded tests. This is already done for the BTP module.

Releases

No releases published

Packages

No packages published

Languages

  • C 90.6%
  • Makefile 5.2%
  • C++ 2.8%
  • Shell 1.1%
  • Other 0.3%