Hash table class to keep track of pages in the buffer pool. More...
#include <bufferHashTable.h>
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) |
Hash table class to keep track of pages in the buffer pool.
Definition at line 43 of file bufferHashTable.h.
wiscdb::BufferHashTable::BufferHashTable | ( | const int | htSize | ) |
Constructor of BufferHashTable class
Definition at line 25 of file bufferHashTable.cpp.
Destructor of BufferHashTable class
Definition at line 33 of file bufferHashTable.cpp.
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.
file | File object |
pageNo | Page number in the file |
frameNo | Frame number assigned to that page of the file |
HashAlreadyPresentException | if 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
file | File object |
pageNo | Page number in the file |
frameNo | Frame number reference containing the result of lookup |
HashNotFoundException | if 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.
HashNotFoundException | if the file/page entry is not found in the hash table |
Definition at line 44 of file bufferHashTable.cpp.