Homework 4
CS422, Spring 2012

Due: Thursday, May 24

Create a zip file of the src folder of your SimpleDB project and upload the zip file to CSNS. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.


Set up SimpleDB project under Eclipse as described in the lecture notes.


1. (40pt) The class Page has methods to get/set only integers and strings. Modify the class to handle doubles, booleans, byte arrays, and dates. Use PageTest.java to test your code.

2. (40pt) Create a new buffer manager that implements the LRU buffer replacement policy. Use BufferManagerTest.java to test your code. To receive full credit for this exercise, the complexity of the pin operation must be less than O(N) where N is the number of buffers in the buffer pool. Discuss the complexity of your implementation in a text file hw4.txt and submit it to CSNS together with the source code zip file.

Note that you may not make any changes to the test code, but you can change the SimpleDB source code in any way necessary.