BadgerDB
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
bufHashTbl.h
1 
8 #pragma once
9 
10 #include "file.h"
11 
12 namespace badgerdb {
13 
17 struct hashBucket {
22 
27 
32 
37 };
38 
39 
46 {
47  private:
51  int HTSIZE;
55  hashBucket** ht;
56 
64  int hash(const File* file, const PageId pageNo);
65 
66  public:
70  BufHashTbl(const int htSize); // constructor
71 
75  ~BufHashTbl(); // destructor
76 
86  void insert(const File* file, const PageId pageNo, const FrameId frameNo);
87 
97  void lookup(const File* file, const PageId pageNo, FrameId &frameNo);
98 
106  void remove(const File* file, const PageId pageNo);
107 };
108 
109 }
BufHashTbl(const int htSize)
Definition: bufHashTbl.cpp:26
std::uint32_t FrameId
Identifier for a frame in buffer pool.
Definition: types.h:25
Declarations for buffer pool hash table.
Definition: bufHashTbl.h:17
hashBucket * next
Definition: bufHashTbl.h:36
Class which represents a file in the filesystem containing database pages.
Definition: file.h:75
std::uint32_t PageId
Identifier for a page in a file.
Definition: types.h:15
void lookup(const File *file, const PageId pageNo, FrameId &frameNo)
Definition: bufHashTbl.cpp:70
Hash table class to keep track of pages in the buffer pool.
Definition: bufHashTbl.h:45
void insert(const File *file, const PageId pageNo, const FrameId frameNo)
Definition: bufHashTbl.cpp:48