buffer

package
v0.0.0-...-d2e8aec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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
}

func GetNewBufferPoolManager

func GetNewBufferPoolManager(buffer_size int, dmi diskio.DiskManager) *BufferPoolManager

func (*BufferPoolManager) AllocatePage

func (bpm *BufferPoolManager) AllocatePage(page_id uint32) page.Page

func (*BufferPoolManager) GetPage

func (bpm *BufferPoolManager) GetPage(page_id uint32) page.Page

not thread safe

func (*BufferPoolManager) Init

func (bpm *BufferPoolManager) Init(buffer_size int, dmi diskio.DiskManager)

func (*BufferPoolManager) PersistAll

func (bpm *BufferPoolManager) PersistAll()

func (*BufferPoolManager) PinPage

func (bpm *BufferPoolManager) PinPage(page_id uint32) bool

func (*BufferPoolManager) UnPinPage

func (bpm *BufferPoolManager) UnPinPage(page_id uint32) bool

type ClockReplacer

type ClockReplacer struct {
	// contains filtered or unexported fields
}

func (*ClockReplacer) GetNextVictim

func (cr *ClockReplacer) GetNextVictim() (int, bool)

func (*ClockReplacer) PinPage

func (cr *ClockReplacer) PinPage(frame_id int)

func (*ClockReplacer) Size

func (cr *ClockReplacer) Size() int

func (*ClockReplacer) UnPinPage

func (cr *ClockReplacer) UnPinPage(frame_id int)

type PageTable

type PageTable struct {
	// contains filtered or unexported fields
}

Ephemeral stays in the volatile storage later could make a decision on using sync.Map vs map with locks ref: https://medium.com/@deckarep/the-new-kid-in-town-gos-sync-map-de24a6bf7c2c

func (*PageTable) Delete

func (pt *PageTable) Delete(key uint32)

func (*PageTable) Get

func (pt *PageTable) Get(key uint32) (int, bool)

func (*PageTable) Init

func (pt *PageTable) Init()

func (*PageTable) InsertOrUpdate

func (pt *PageTable) InsertOrUpdate(key uint32, val int)

type Replacer

type Replacer interface {
	GetNextVictim() (int, bool)
	PinPage(frame_id int)
	UnPinPage(frame_id int)
	Size() int
}

func NewClockReplacer

func NewClockReplacer(buffer_size int) Replacer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL