wisc_db
|
#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) |
@brief Hash table class to keep track of pages in the buffer pool
Definition at line 44 of file bufferHashTable.h.
wiscdb::BufferHashTable::BufferHashTable | ( | const int | htSize | ) |
Constructor of BufferHashTable class
wiscdb::BufferHashTable::~BufferHashTable | ( | ) |
Destructor of BufferHashTable class
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.
@param file File object @param pageNo Page number in the file @param frameNo Frame number assigned to that page of the file @throws HashAlreadyPresentException if the corresponding file/page already exists in the hash table
Check if (file, pageNo) is currently in the buffer pool (ie. in the hash table). Returns frame number of location in pool
@param file File object @param pageNo Page number in the file @param frameNo Frame number reference containing the result of lookup @throws HashNotFoundException if the file/page entry is not found in the hash table
Remove (file,pageNo) the buffer pool by deleting the appropriate item from hash table.
@param file File object @param pageNo Page number in the file @throws HashNotFoundException if the file/page entry is not found in the hash table