WiscDB
 All Classes Namespaces Functions Variables Typedefs Enumerations 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

Destructor of BufferHashTable class


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
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
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

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends