1. Goals for this week
We will not be going into all of the details on the SwatDB and the Lab 2: SwatDB Buffer Manager ssignment during Wednesday lab. You are responsible for reading both before arriving to lab. Failure to do so will result in wasting lab time that would otherwise be used to ask questions and complete exercises in lab.
Together, let’s review SwatDB by looking at the SwatDB information page. Note its layered design looks a lot like what we have been discussing in lecture.
We will also briefly look at the SwatDB on-line documentation. Note that we can view documentation by class or by file.
For lab assignments, if we give you a
.h file in the starting point code,
look at that file for the interface that you need to implement vs. the
on-line documentation; some lab assignments may implement SwatDB
functionality in a slightly different way than it is implemented in
the real SwatDB system.
2.1. SwatDB Buffer Manager
Next we are going to review the Lab 2: SwatDB Buffer Manager assignment that you read over before lab today.
We are going to do the following:
Overview of the assignment, the classes you need to implement. Use both the details (in the
Detailssection) of methods you need to implement, and the method comments in
bufmgr.hto help you determine what and how to implement each method.
Let’s look at the test code.
Let’s open the
bufmgr.hclass and look at the BufferMap class definition. Together, lets start implementing the
We are going to send you and your partner to a breakout room to try to finish these two methods after we get started together. If you get these done, move on to implementing other ones before we come back to go over these.
You can test out your solution by running the
./checkpt -s BufMapTest
Next, we are going to get you started on the
allocatePagemethod. After looking at the details of this method, you and your partner should come up with pseudocode for its main steps. We will give you just 5 minutes or so to do this. Refine a bit if you have time after coming up with the big steps. We will come back and discuss this together.
2.2. C++ Reminders
In particular, if you are still a bit rusty using
take some time to review them again so you are comfortable using
them to debug this lab. It will save you hours and hours of debugging
time to uses these tools, and we will ask you what you discovered
valgrind about bugs you have in your program that you
want us to help you with--we expect that you are using
valgrind to debug.
These pages, as well as the Lab 2: SwatDB Buffer Manager assignment page has links to all kinds of C++ programming resources.