Computer Science 4611
Database Management Systems

Programming Assignment 3
Heap Files (85 points)
Due Tuesday, March 27 2001

Introduction

In programming assignments 2-5, you will implement a simple DBMS. For an overview of how you will construct the DBMS, read this page. For this assignment you will implement a mechanism for Heap Files, without support for concurrency control or recovery. You will use code provided for the lowest layer, the Disk Space Manager and other base routines. You should then add the code you implemented for the Buffer Manager layer from the previous assignment.

You can find your team assignment here. You should begin by reviewing the chapters on storing data and file organization to to get an overview. This material will also be covered in class. Your Heap File manager code will make use of the Buffer Manager layer and provide a basic file mechanism that will be used by upper layers.

To make a local copy of the code you need to implement you should download the file hf.tar.Z. This is a tared archive file. To unpack this file you should do the following:

  % uncompress hf.tar
  % tar xvf hf.tar

This will create a directory HeapFile that contains the code provided to you as well as skeletons for the code you need to write. This code comes with a provided make file makefile. It is unlikely you will need to modify this file (the only files you should need to change are heapfile.h, heapfile.C, hfpage.h, hfpage.C, scan.h and scan.C). The code also comes with a testing program hf_tester. This test programs is automatically constructed by the makefile by simply typing "make". To recompile all of the code you first type "make clean" which will eliminate all current .o and executable files and then type "make" again to recompile. Note that you will have to copy your buf.h and buf.C programs to this directory for it to compile.

For those who did not get the first part of the project working, you can download the archive hfa.tar.Z. This has a library with a working buf.C program.

Heap Files Interface

The Heap File interface you will be implementing has three parts:

The methods you have to implement are described in the header files (hfpage.h, heapfile.h and scan.h).

Error Protocol and Debugging

Be sure to follow the error protocol described in new_error.h. Note that you will likely want to add new error codes and new error messages to the tables provided for you.

The make file compiles the code using the -g flag. This means that you can debug the executables produced using gdb. I have also set up the code with a command line debugging system. When running either of the test programs you can add command line arguments of db, bm, hf, or gory. These turn on debugging flags in the Disk Space module (db), Buffer Manager module (bm), HeapFile (hf) and some extended (gory details) flags (gory). Note that you may want to add debugging commands in your Buffer Manager code following this protocol.

What to Turn In, and When

Print out your versions of hfpage.h, hfpage.C, heapfile.h, heapfile.C, scan.h, and scan.C. You should test your code using the test routine hf_tester and print out the results. Next, write up a team report of how your code is implemented. This report should give an overview of how you completed the classes for Heap Files. It should also discuss the algorithms you used to solve the problem. This report should be at least two pages long but no longer than four pages. Each team member should also write up an individual report (at least half a page but no more than a page) discussing their contributions to the coding process and how the overall team interaction went.