Documentation
¶
Index ¶
- type BufferPoolManager
- func (b *BufferPoolManager) DeletePage(pageID types.PageID) error
- func (b *BufferPoolManager) FetchPage(pageID types.PageID) *page.Page
- 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) NewPage() *page.Page
- 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) DeletePage ¶
func (b *BufferPoolManager) DeletePage(pageID types.PageID) error
DeletePage deletes a page from the buffer pool.
func (*BufferPoolManager) FetchPage ¶
func (b *BufferPoolManager) FetchPage(pageID types.PageID) *page.Page
FetchPage fetches the requested page from the buffer pool.
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) NewPage ¶
func (b *BufferPoolManager) NewPage() *page.Page
NewPage allocates a new page in the buffer pool with the disk manager help
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) 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