WiscDB
 All Classes Functions Variables Friends
Public Member Functions
wiscdb::BufferHashTable Class Reference

Hash table class to keep track of pages in the buffer pool. More...

#include <bufferHashTable.h>

List of all members.

Public Member Functions

 BufferHashTable (const int htSize)
 ~BufferHashTable ()
void insert (const File *file, const PageId pageNo, const FrameId frameNo)
void lookup (const File *file, const PageId pageNo, FrameId &frameNo)
void remove (const File *file, const PageId pageNo)

Detailed Description

Hash table class to keep track of pages in the buffer pool.

Definition at line 43 of file bufferHashTable.h.


Constructor & Destructor Documentation

Constructor of BufferHashTable class

Definition at line 25 of file bufferHashTable.cpp.

Destructor of BufferHashTable class

Definition at line 33 of file bufferHashTable.cpp.


Member Function Documentation

void wiscdb::BufferHashTable::insert ( const File file,
const PageId  pageNo,
const FrameId  frameNo 
)

Insert entry into hash table. Maps (file, pageNo) to bucket and inserts a HashItem.

Parameters:
fileFile object
pageNoPage number in the file
frameNoFrame number assigned to that page of the file
Exceptions:
HashAlreadyPresentExceptionif the corresponding file/page already exists in the hash table

Definition at line 36 of file bufferHashTable.cpp.

void wiscdb::BufferHashTable::lookup ( const File file,
const PageId  pageNo,
FrameId &  frameNo 
)

Check if (file, pageNo) is currently in the buffer pool (ie. in the hash table). Returns frame number of location in pool

Parameters:
fileFile object
pageNoPage number in the file
frameNoFrame number reference containing the result of lookup
Exceptions:
HashNotFoundExceptionif the file/page entry is not found in the hash table

Definition at line 40 of file bufferHashTable.cpp.

void wiscdb::BufferHashTable::remove ( const File file,
const PageId  pageNo 
)

Remove (file,pageNo) the buffer pool by deleting the appropriate item from hash table.

Parameters:
fileFile object
pageNoPage number in the file
Exceptions:
HashNotFoundExceptionif the file/page entry is not found in the hash table

Definition at line 44 of file bufferHashTable.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends