New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Adele Schaden MD


Adele Schaden MD
GPA 3.88


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 4 page Class Notes was uploaded by Adele Schaden MD on Thursday October 29, 2015. The Class Notes belongs to CS 179G at University of California Riverside taught by Staff in Fall. Since its upload, it has received 34 views. For similar materials see /class/231758/cs-179g-university-of-california-riverside in ComputerScienence at University of California Riverside.

Similar to CS 179G at UCR

Popular in ComputerScienence




Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/29/15
Minibase Sl10rt Tutorial Introduction The Minibase DBMS has been implemented in C following the object oriented paradigm The whole system consists of four subsystems the Catalog where metadata information is kept the Storage Manager which takes care of the page allocation and deallocation the Bu er Manager which takes care of the page fetching in memory and the formers ushing out to disk and the Query Processing System which implements some relational operators Each subsystem communicates with the other subsystems thought the public methods that each of the contained classes define Each subsystem can be decomposed into further subsystems For the purposes of the current project we will deal mainly with the storage manager as well as the buffer manager Moreover we will ignore the catalog completely The objects that implement the storage manager and the buffer manager are defined as global variables and can be accessed as well as their methods using the MINIBASEiDB and MINIBASEiBM macros respectively Before going on to explain the functionality that each subsystem provides in detail we will explain the error protocol that is used to propagate errors between subsystems and how the latter should be utilized Error Protocol Every subsystem creates error messages that describe the possible errors that will result When an error is detected by a subsystem for the rst time that subsystem adds an error message to the global queue The subsystem that discovered the error then returns a status code that indicates what subsystem it is it identifies itself to the caller by returning its own ID If thecaller cannot recover from the error the caller must then append a new error to the global queue In this case however the thing appended to the queue is not a new message but simply a pair of subsystem IDs the original subsystem39s ID and the calling subsystem39s ID Here is a possible hypothetical example of the errors that will be logged in the global error object DBMGR quotFile Not Openquot MGR 01 C1 11 w U 01 BTREE BUFMGR JOINS BTREE PLANNER JOINS FRONTEND PLANNER Note that there is some redundancy here the recipient of an error is the source of an error in the next level This helps ensure that the protocol is being followed properly The current protocol has all errors entered into a given variable of type Status This variable is checked If OK then proceed If OK then call globalierrorxaddierror All errors must then be returned to the caller Problem destructors are unable to set a nonglobal variable to a value They can call globalierror39addierr0r0 but there is no way for them to communicate failures Error Numbers When a subsystem posts a first error it provides an error number that is specific to that subsystem Each subsystem has its own set of error numbers independent of the other subsystems These numbers may become part of the subsystem39s public interface it is permissible to advertise what error numbers will be used in what circumstances so that callers can recognize different conditions and handle the errors accordingly Implementation The simplest approach for declaring error numbers is to provide an enumeration For example here is the start of the buffer manager39s enumeration of errors enum bufErrCodes HASH T BLERROR HASHNOT F O UND B UFFEREXCEEDED Error Messages Corresponding to its set of error numbers each subsystem also must declare an array of error messages and must make these messages available to the global error object The index into the array must match the number of the corresponding error Implementation Here is an excerpt from the buffer manager39s array of error messages corresponding to the above enumeration static const char bufErrMsgs quothash table errorquot quothash entry not found quot quotbu krpoolfullquot This array of strings is declared static So how can the buffer manager make these strings available to the global error object By creating a static erroristringitable object The constructor of this object registers the error messages with the system when the program first starts Here is the buffer manager39s error stringitable declaration in the same file as the above array of strings static erroristringitable bufTableBUFMGR bufErrMsgs Posting Errors There are three macros de ned that make it easy to add errors when one discovers them These macros also add the name of the le and the line number where the error happens as a debugging aid 0 To add a rst error one may use the MINIBASEiFIRSTiERROR macro For example if the buffer manager detects that the buffer pool is too full to complete an operation it posts its B UFFEREXCEEDED error like this MINIBASEiFIRSTiERROR B UFM GR B UFFEREXCEEDED To add a chained error one may use the MINIBASEfCHAINiERROR macro For example if the buffer manager calls on the database manager to write a page to disk and that operation fails the buffer manager adds an error that records the fact that the execution path that failed went through it Status status MINIBASEiDB gtwritelzage ifstatus OK return MINIBASEiCHAINiERROR B UFMGR status Sometimes one wishes to post a different error message but still acknowledge that the error resulted from a prior error This is a combination of the above situations For this one may use the MINIBASEiRESULTINGiERROR macro Status status MINIBASEiDB gtwritelzage ifstatus OK return MINIBASEiRES ULTINGfERROR S UFM GR status B UFFEREXCEEDED Handling Errors There are a number of ways to find out what has gone wrong in the system The most primitive way is to print the global error object min ibaseierrorsshowierrorsO39 If one needs the program to detect whether an error has happened one may ask the error object if it has accumulated any errors if minibusegarrorserrorO One may find out the subsystem that posted the first error if minibaseierrorsoriginatorO BUFMGR One may find out the error number of the first error if minibaseierrorserroriindexO BUFFEREXCEEDED If you wish to examine the entire set of errors that have been posted you may use the error method shown above to get a pointer to the rst error record in the list you may then use methods of the errorinode class to get details of the error and to traverse the entire list of errors Status values There are four groups of status codes 0 OK This is the normal return status It is in a class by itself 0 The layer or subsystem ID status codes BUFMGR RECOVERYMGR LOGMGR SHAREDMEMORYMGR BTREE SORTEDPAGE BTINDEXPAGE BTLEAF PAGE LINEARHASH GRIDFILE RTREE JOINS PLANNER PARSER OPTIMIZER FRONTEND CATALOG DBMGR RAWFILE LOCKMGR XACTMGR HEAPFILE SCAN A subsystem notifies its caller of an error by adding an error to the global error list and returning its subsystem ID status code The caller may then inspect the error and decide how to handle it 0 DONE and FAIL DONE is a special code for nonerrors that are nonetheless not OK it generally means nished or not found FAIL is for errors that happen outside the bounds of a subsystem 0 The last category is a set of deprecated status codes that refer to specific problems These are being replaced by the subsystem and error indeX mechanism as time permits Storage Manager Each database is basically a UNIX file and consists of several relations viewed as heapfiles and their indexes within it The storage manager creates and manipulates the database It keeps two basic kinds of global information The first is a map of which database pages have been allocated The second is a directory of files created within the database The first page of the database page ID 0 is reserved for a special structure that holds global information about the database like the number of pages in the database After this special firstpage information comes the first of possibly many directory page A directory page is where the storage manager keeps track of the les created within the


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Anthony Lee UC Santa Barbara

"I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.