Skip to content

PLW/blink-tree-logic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#
#  This B-Link tree code is based on research published by Kark Malbrain ([KM]).
#  The code is derived and re-written from original 'C' source code placed
#  in the public domain by Karl Malbrain.  See:
#
#    http://arxiv.org/ftp/arxiv/papers/1009/1009.2764.pdf
#    https://code.google.com/p/high-concurrency-btree/
#
#  The [KM] code makes reference to research published by Ibrahim Jaluta ([IJ]):
#
#    "B-tree Concurrency Control and Recovery in a Client-Server Database
#    Management System", Dissertation for the degree of Doctor of Science
#    in Technology, Helsinki University (2002).
#
#  The original proposal for B-Link trees is due to Lehman and Yao ([LY]):
#
#    "Efficient locking for concurrent operations in B-trees", ACM Transactions
#    Database Systems 6 (1981).
#
#  See the bibliography of [IJ] for numerous additional useful references.

# compile everything
g++ -O3 -o random_keys random_keys.cpp
g++ -DSTANDALONE -O3 -o logger logger.cpp logger_test.cpp
g++ -DSTANDALONE -O3 -o page page.cpp page_test.cpp
g++ -DSTANDALONE -O3 -o latchmgr logger.cpp page.cpp latchmgr.cpp latchmgr_test.cpp
g++ -DSTANDALONE -O3 -o bufmgr logger.cpp bltval.cpp latchmgr.cpp bufmgr.cpp bufmgr_test.cpp
g++ -DSTANDALONE -O3 -o bltree logger.cpp bltval.cpp latchmgr.cpp bufmgr.cpp bltree.cpp bltree_test.cpp -lpthread

# create a file of random keys
./random_keys >keys.txt

# unit test page manager code (only makes sense for an existing index)
#    ./page FNAME PAGE_BIT_SIZE
./page testdb 15

# unit test thread-safe logging
./logger

# unit test latch manager
./latchmgr

# unit test buffer pool manager (only makes sense for an existing index)
#    ./bufmgr FNAME PAGE_BIT_SIZE
./bufmgr testdb 15

# test BLink Tree 
#    ./bltree
#        -f dbname            - the name of the index file(s)
#        -c cmd,cmd,..        - list of: Audit, Write, Delete, Find, Scan, Count, one per thread
#        -k k_1,k_2,..        - matching list of source key files k_i, one per thread
#        -p PageBits          - page size in bits
#        -n PoolSize          - number of buffer pool mmapped page segments
#        -s SegBits           - segment size in pages in bits
#
# (e.g.) 32KB pages, 8192 segments of 32 pages each = 8GB total storage

rm -f testdb
./bltree -f testdb -c Write -k keys.txt -p 15 -n 8192 -s 5
./bltree -f testdb -c Scan,Find,Find -k keys.txt,keys.txt,keys.txt -p 15 -n 8192 -s 5

About

BLInk Tree logic - storage and locking experiment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published