CS432/433

Assignment 2

Buffer Manager

Deadline : September 23, 1998 3:20 PM.

Please check this page frequently for any updates or clarification.

09/21/98 - Added Instruction to select replacement policy.

This page was last updated on 09/21/98.

Click Here for instruction on selecting replacement policy.

Introduction

In this assignment you will need to implement a buffer manager. The buffer manager is responsible for bringing pages from the disk to the main memory as needed. The buffer manager:

In addition, you will be required to run experiments studying the effect the size of the buffer pool has on performance and present your results.

Description and Specifications

You will be given the code that implements a database class (DB) and a page class (Page). The definition of public interface for the buffer manager class (BufMgr) is available, but is not implemented. You can find out more about the implemented classes and types here :

Also, you'll be given a visualization tool, "BufferSim",  which simulates buffer manager operations.

The source code for the project is located in the directory \\goose\courses\Cs432\A2. The directory contains:

You are required to modify and fill in the gaps in bufmgr.cpp and bufmgr.h, specifically :

Presenting Statistical Data:

For each of the replacement policy you implemented (MRU and Clock), you need to do the following:

       1) After your tests have run successfully, you will need to run some experiments while varying the buffer size, and describe the effects a larger buffer pool has on the statistics (including time) that you have collected. You should also explain these variations.
        2) Running the experiments is basically running the tests provided for you again with different buffer sizes. At this point you should also look at the test procedures and see why the buffer size increases will affect the performance.  (note: we are only interested in statistics relating to the fourth and fifth tests.)
        3) In order to change the buffer size go to the file minirel.h and change the value of the constant NUMBUF. The buffer sizes recommended are 50,100,150,200, and 250. (Note: The project you submit should have buffer size 50 only. We don't want five copies of everybody's project)
        4) Remember to close all major applications on your computer before running the tests, since they will affect the time it takes to run the tests.
 
In addition, you should then constrast the performance of the buffer manager when using these two replacement policies. Remember that if you define the replacement policy as a base class with virtual functions then all you have to do is derive the MRU class and implement the functions using the MRU algorithm. This will involve minimum change in your buffer manager code.

Coding Convention

You need to follow certain coding convention for all your assignments.

Hints & Notes

Submission Procedure

How to hand in:

You should remember to keep a copy of the project in your own account.

This assignment is due on  September 23, 1998 3:20 PM. No late submissions will be accepted.

Marking Criteria

We will mark your programs based on the following criteria :

Correctness (65%)
You will get full marks if your implementation is correct. Partial credit will be given to a partially correct submission.
Coding Style (15%)
We expect you to write neat code. Code should be nicely indented and commented. We also expect you to follow the coding conventions.
Statistical Analysis (10%)
        You should clearly describe what effects a larger buffer pool has on performance and why. You should use the statistics you collect to support your reasoning.
Documentation (10%)
You should also submit the online copy of your documentation using any format you like. (WordPerfect, MS Word, HTML etc.), explaining the code that you have written. This should include assumptions that you made, description of any new class that you have added, and any other special feature we should take note of. As a guideline, the document should be 2-3 pages long (with normal fonts and spacing), or more if you feel necessary.

Collaboration

Project will be done in teams of two.

Both team members will receive the same grade. Also, collaboration across teams is not allowed, beyond discussing broad logical ideas (eg. how does the clock algorithm work?) and C++ doubts (e.g.. how does one initialize static variables?). Looking at the code from another team is also not allowed. In any situation where a team feels that it may have compromised one of these guidelines, the right thing to do is to state the details along with the project submission.

Miscellaneous

Please let us know if there is any ambiguity in the assignment and please report any possible bugs as soon as possible by  mailing a TA .

There are now two newsgroups for the class : cornell.class.cs432 and cornell.class.cs433, for general discussions. Please use cornell.class.cs432 for discussion for this assignment.