wisc_db
Public Member Functions | List of all members
wiscdb::BufferHashTable Class Reference

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

Detailed Description

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

Definition at line 44 of file bufferHashTable.h.

Constructor & Destructor Documentation

wiscdb::BufferHashTable::BufferHashTable ( const int  htSize)

Constructor of BufferHashTable class

wiscdb::BufferHashTable::~BufferHashTable ( )

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.

@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

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

@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

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

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


The documentation for this class was generated from the following file: