1. Goals for this week

  1. Quick review of SwatDB and using its on-line documentation, and also reading class definitions from .h files.

  2. Overview of the Lab 2: SwatDB Buffer Manager Assignment.

  3. Together start implementing parts of Lab 2: SwatDB Buffer Manager based on documentation

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.

2. SwatDB

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:

  1. Overview of the assignment, the classes you need to implement. Use both the details (in the Details section) of methods you need to implement, and the method comments in bufmgr.h to help you determine what and how to implement each method.

  2. Let’s look at the test code.

  3. Let’s open the bufmgr.h class and look at the BufferMap class definition. Together, lets start implementing the insert and contains methods.

    • 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 BufMapTest test suite:

        ./checkpt -s BufMapTest
  4. Next, we are going to get you started on the BufferManager allocatePage method. 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

Look at the Wed Lab from Week 1 and Wed Lab from Week 2 pages for reminders about specify C++ programming and debugging tools and example programs we tried out for practice.

In particular, if you are still a bit rusty using gdb and valgrind, 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 from gdb and valgrind about bugs you have in your program that you want us to help you with--we expect that you are using gdb and 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.