This project is for NTU's CZ4031 module. It is a implementation of a B+ tree index component and a simulated disk storage component to store records from data/data.tsv, which contain information about movies from IMDB.
The project is written in C++.
To compile and run the code, you will first need a C++ compiler (e.g. g++).
- Download all files from the repo (including data folder)
git pull https://github.com/bobbyrayyy/cz4031BPT
- cd to the 'src' directory
cd src
- Compile each '.cpp' file.
(MacOS users: I added -std=c++11 flag to solve compilation error.)
g++ -c main.cpp bpt/bplustree.cpp bpt/bplustree_delete.cpp bpt/bplustree_insert.cpp bpt/bplustree_search.cpp storage/disk_storage.cpp
- Link main.exe file
g++ -o main.exe bplustree_insert.o bplustree_delete.o bplustree_search.o bplustree.o disk_storage.o main.o
Note that *.o files will all be in current directory (sane level).
- Setting block size and paramenter n
- To run experiment with block size 200B, go to disk_storage.h and uncomment lines 13 and 14, and comment out lines 17 and 18.
- To run experiment with block size 500B, go to disk_storage.h and comment out lines 13 and 14, and uncomment lines 17 and 18.
- (Clear instructions in disk_storage.h)
- Run main.exe
./main.exe
Experiment results are printed in terminal.
- Bob Lin
- Gareth
- Jin Han
- Kai Feng
- Louis