In this assignment, you will implement the page structure for the Heap File layer.
You can find the API for relevant files by clicking on the appropriate link for Java or C++.
Begin by reading the description of Heap Files in section 9.5.1 of the text book, and the description of page formats in section 9.6. A HeapFile is seen as a collection of records. Internally, records are stored on a collection of pages. The pages are HFPage objects.
For this assignment, you will be implementing the HFPage class: a slotted page class that stores variable length records. The rest of the HeapFile code will be given to you. Read the description in the text of how variable length records can be stored on a slotted page, and follow this page organization.
If you are coding in Java, learn about the IntBuffer class, as well as the System.arraycopy method. If you are coding in C++, learn about the C functions memcpy and memmove.
Start by grabbing the Java or C++ zip files and extract to a directory that you have created. The project contains the following files, among others:
The list of the specific methods that you need to implement are contained in the Java and C++ APIs.
Throw exceptions appropriately. The API describes what exceptions should be thrown when something goes wrong. If you are coding in C++, take a look at DBFile.h and DBFile.cpp to see how to throw exceptions within Minibase.
If you are working in a team, only one of you should submit the code. Make sure that both of your names appear in program documentation at the top.
If you are coding in C++, we will run purify on your code to make sure that that your program exhibits no memory leaks or other bad memory behavior. You should run purify on your code before turning it in to see if you have memory issues.
Zip up all of your code, and submit it via Moodle.
Good luck, have fun, and ask questions!