Documentation
¶
Index ¶
- type BufferPoolManager
- func (b *BufferPoolManager) DeallocatePage(pageID types.PageID) error
- func (b *BufferPoolManager) DecPinOfPage(page_ page.PageIF)
- func (b *BufferPoolManager) FetchPage(pageID types.PageID) *page.Page
- func (b *BufferPoolManager) FlushAllDirtyPages()
- func (b *BufferPoolManager) FlushAllPages()
- func (b *BufferPoolManager) FlushPage(pageID types.PageID) bool
- func (b *BufferPoolManager) GetPages() []*page.Page
- func (b *BufferPoolManager) GetPoolSize() int
- func (b *BufferPoolManager) IncPinOfPage(page_ page.PageIF)
- func (b *BufferPoolManager) NewPage() *page.Page
- func (b *BufferPoolManager) PrintBufferUsageState(callerAdditionalInfo string)
- func (b *BufferPoolManager) PrintReplacerInternalState()
- func (b *BufferPoolManager) UnpinPage(pageID types.PageID, isDirty bool) error
- type ClockReplacer
- type FrameID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPoolManager ¶
type BufferPoolManager struct {
// contains filtered or unexported fields
}
BufferPoolManager represents the buffer pool manager
func NewBufferPoolManager ¶
func NewBufferPoolManager(poolSize uint32, DiskManager disk.DiskManager, log_manager *recovery.LogManager) *BufferPoolManager
NewBufferPoolManager returns a empty buffer pool manager
func (*BufferPoolManager) DeallocatePage ¶ added in v0.0.2
func (b *BufferPoolManager) DeallocatePage(pageID types.PageID) error
DeallocatePage make disk space of db file which is idenfied by pageID ATTENTION: when deallocated page is requested fetch, BPM return nil
func (*BufferPoolManager) DecPinOfPage ¶ added in v0.0.2
func (b *BufferPoolManager) DecPinOfPage(page_ page.PageIF)
Decrement pin count of passed page (this can be used only when a thread has pin of page more than 1 this get lock of BufferPoolManager but overhead is smaller than UnpinPage
func (*BufferPoolManager) FetchPage ¶
func (b *BufferPoolManager) FetchPage(pageID types.PageID) *page.Page
FetchPage fetches the requested page from the buffer pool.
func (*BufferPoolManager) FlushAllDirtyPages ¶ added in v0.0.2
func (b *BufferPoolManager) FlushAllDirtyPages()
FlushAllDitryPages flushes all dirty pages in the buffer pool to disk.
func (*BufferPoolManager) FlushAllPages ¶
func (b *BufferPoolManager) FlushAllPages()
FlushAllPages flushes all the pages in the buffer pool to disk.
func (*BufferPoolManager) FlushPage ¶
func (b *BufferPoolManager) FlushPage(pageID types.PageID) bool
FlushPage Flushes the target page to disk.
func (*BufferPoolManager) GetPages ¶
func (b *BufferPoolManager) GetPages() []*page.Page
func (*BufferPoolManager) GetPoolSize ¶
func (b *BufferPoolManager) GetPoolSize() int
func (*BufferPoolManager) IncPinOfPage ¶ added in v0.0.2
func (b *BufferPoolManager) IncPinOfPage(page_ page.PageIF)
Decrement pincount of passed page (this can be used only when a thread has pin of page more than 1 this get lock of BufferPoolManager
func (*BufferPoolManager) NewPage ¶
func (b *BufferPoolManager) NewPage() *page.Page
NewPage allocates a new page in the buffer pool with the disk manager help
func (*BufferPoolManager) PrintBufferUsageState ¶ added in v0.0.2
func (b *BufferPoolManager) PrintBufferUsageState(callerAdditionalInfo string)
func (*BufferPoolManager) PrintReplacerInternalState ¶ added in v0.0.2
func (b *BufferPoolManager) PrintReplacerInternalState()
type ClockReplacer ¶
type ClockReplacer struct {
// contains filtered or unexported fields
}
*
- ClockReplacer implements the clock replacement policy, which approximates the Least Recently Used policy.
func NewClockReplacer ¶
func NewClockReplacer(poolSize uint32) *ClockReplacer
NewClockReplacer instantiates a new clock replacer
func (*ClockReplacer) Pin ¶
func (c *ClockReplacer) Pin(id FrameID)
Pin pins a frame, indicating that it should not be victimized until it is unpinned
func (*ClockReplacer) PrintList ¶ added in v0.0.2
func (c *ClockReplacer) PrintList()
func (*ClockReplacer) Size ¶
func (c *ClockReplacer) Size() uint32
Size returns the size of the clock
func (*ClockReplacer) Unpin ¶
func (c *ClockReplacer) Unpin(id FrameID)
Unpin unpins a frame, indicating that it can now be victimized
func (*ClockReplacer) Victim ¶
func (c *ClockReplacer) Victim() *FrameID
Victim removes the victim frame as defined by the replacement policy