In this assignment, you will implement the structure for a page that contains variable width records via the use of a slot array.
Begin by reading the description of file organization techniques in section 10.5 of the text book, focusing specifically on section 10.5.2.
For this assignment, you will be implementing the SlottedPage class, which wraps around a disk Page. Specifically, you will implement the approach described in section 10.5.2.
You'll be coding in Java. You'll want to read about the IntBuffer class in particular, as well as System.arraycopy.
For IntBuffer, you'll only need two methods: get(int index) and put(int index, int i).
Start by grabbing the project zip files and extract to a directory you have created. The project contains the following files, among others:
I've create a Makefile which will compile your code for you. At the terminal prompt, type:
makeand it will generate all the Java class files. To run the test program, type
java SPTesterThese tests are not sufficient to see if your code is working properly. You will want to write more tests.
You can type
make cleanat a prompt to delete all of the class files.
Part 1: Get the first two tests (i.e., test1 and test2) to run correctly.
Part 2: Get the rest of the functions in pageorg.py implemented, and test them. Make sure to test edge cases (full page, empty page, all of that kind of thing); we will attempt to do so when grading.
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.
Zip up all of your code, and submit it via Moodle.
Good luck, have fun, and ask questions!