10#ifndef _SWATDB_BM_REPLACEMENT_H_
11#define _SWATDB_BM_REPLACEMENT_H_
Definition bm_replacement.h:29
void _createFree()
Creates a free list for the buffer pool by checking each frame in the buffer pool and checking if it ...
void printFrame(FrameId frame_id)
THIS METHOD IS FOR DEBUGGING ONLY. Prints Frame state relevant to the replacement policy of a given F...
virtual RepType _getType()=0
Returns the type of a given replacement policy. Used to fill struct of replacement statistics.
virtual void freeFrame(FrameId frame_id)
Virtual method that implements any necessary update to replacement policy state following the dealloc...
virtual void printStats()=0
Pure virtual method for printing relevant stats for the specific derived class.
std::uint64_t rep_calls
Definition bm_replacement.h:167
virtual void getRepStats(struct BufferState::ReplacementStats *rep_stats)
Updates the struct of replacement policy statistics within the buffer state struct....
virtual void pin(FrameId frame_id)=0
Pure virtual method that implements any necessary update to replacement policy state following the pi...
std::uint64_t new_page_calls
Definition bm_replacement.h:181
virtual FrameId replace()=0
Pure virtual method that implements core replacement policy functionality in child classes.
double avg_frames_checked
Definition bm_replacement.h:173
virtual ~ReplacementPolicy()
Empty Destructor.
Frame * frame_table
Definition bm_replacement.h:156
void advanceCalls()
Increment new_page_calls by 1. Called in both allocatePage and getPage in BufferManager.
virtual void unpin(FrameId frame_id)=0
Pure virtual method that implements any necessary update to replacement policy state following the un...
std::queue< FrameId > free
Definition bm_replacement.h:161
std::uint32_t FrameId
Index of each frame in the bufferpool of BufferManager.
Definition swatdb_types.h:44
RepType
Definition swatdb_types.h:167