Documentation ¶
Overview ¶
Package pageview contains object wrappers for different page types.
DataPage ¶
DataPage is a page which holds actual data.
FreeLogicalSlotPage ¶
FreeLogicalSlotPage is a page which holds information about free logical slots. The page stores the slot location in a slotinfo data structure.
FreePhysicalSlotPage ¶
FreePhysicalSlotPage is a page which holds information about free physical slots. The page stores the slot location and its size in a slotinfo data structure (see util/slotsize.go).
SlotInfoPage ¶
SlotInfoPage is the super-struct for all page views which manage slotinfos. Slotinfo are location (see util/location.go) pointers into the data store containing record id and offset.
TransPage ¶
TransPage is a page which holds data to translate between physical and logical slots.
Index ¶
- Constants
- type DataPage
- type FreeLogicalSlotPage
- func (flsp *FreeLogicalSlotPage) AllocateSlotInfo(slotinfo uint16) uint16
- func (flsp *FreeLogicalSlotPage) FirstAllocatedSlotInfo() int
- func (flsp *FreeLogicalSlotPage) FirstFreeSlotInfo() int
- func (flsp *FreeLogicalSlotPage) FreeSlotCount() uint16
- func (flsp *FreeLogicalSlotPage) MaxSlots() uint16
- func (flsp *FreeLogicalSlotPage) ReleaseSlotInfo(slotinfo uint16) uint16
- func (flsp *FreeLogicalSlotPage) SlotInfoLocation(slotinfo uint16) uint64
- type FreePhysicalSlotPage
- func (fpsp *FreePhysicalSlotPage) AllocateSlotInfo(slotinfo uint16) uint16
- func (fpsp *FreePhysicalSlotPage) FindSlot(minSize uint32) int
- func (fpsp *FreePhysicalSlotPage) FirstFreeSlotInfo() int
- func (fpsp *FreePhysicalSlotPage) FreeSlotCount() uint16
- func (fpsp *FreePhysicalSlotPage) FreeSlotSize(offset uint16) uint32
- func (fpsp *FreePhysicalSlotPage) MaxSlots() uint16
- func (fpsp *FreePhysicalSlotPage) ReleaseSlotInfo(slotinfo uint16) uint16
- func (fpsp *FreePhysicalSlotPage) SetFreeSlotSize(offset uint16, size uint32)
- func (fpsp *FreePhysicalSlotPage) SlotInfoLocation(slotinfo uint16) uint64
- type SlotInfoPage
- type TransPage
Constants ¶
const OffsetCount = view.OffsetData
OffsetCount is the number of free slots which are stored on this page
const OffsetData = OffsetCount + file.SizeShort
OffsetData is the offset for slot information
const OffsetFirst = view.OffsetData
OffsetFirst is a pointer to first element on the page
const OffsetTransData = view.OffsetData
OffsetTransData is the data offset for translation pages
const OptimalWasteMargin = 128
OptimalWasteMargin is the max amount of allowed allocation waste. When searching a slot on this page we should strife to find a slot which doesn't waste more than OptimalWasteMargin bytes
const SlotInfoSize = util.LocationSize + util.SizeInfoSize
SlotInfoSize is the size of a single free slot info
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataPage ¶
type DataPage struct {
*SlotInfoPage
}
DataPage data structure
func NewDataPage ¶
NewDataPage creates a new page which holds actual data.
func NewTransPage ¶
NewTransPage creates a new page which holds data to translate between physical and logical slots.
func (*DataPage) OffsetFirst ¶
OffsetFirst returns the pointer to the first element on the page.
func (*DataPage) SetOffsetFirst ¶
SetOffsetFirst sets the pointer to the first element on the page.
type FreeLogicalSlotPage ¶
type FreeLogicalSlotPage struct { *SlotInfoPage // contains filtered or unexported fields }
FreeLogicalSlotPage data structure
func NewFreeLogicalSlotPage ¶
func NewFreeLogicalSlotPage(record *file.Record) *FreeLogicalSlotPage
NewFreeLogicalSlotPage creates a new page which can manage free slots.
func (*FreeLogicalSlotPage) AllocateSlotInfo ¶
func (flsp *FreeLogicalSlotPage) AllocateSlotInfo(slotinfo uint16) uint16
AllocateSlotInfo allocates a place for a slotinfo and returns the offset for it.
func (*FreeLogicalSlotPage) FirstAllocatedSlotInfo ¶
func (flsp *FreeLogicalSlotPage) FirstAllocatedSlotInfo() int
FirstAllocatedSlotInfo returns the id for the first allocated slotinfo or -1 if nothing is allocated.
func (*FreeLogicalSlotPage) FirstFreeSlotInfo ¶
func (flsp *FreeLogicalSlotPage) FirstFreeSlotInfo() int
FirstFreeSlotInfo returns the id for the first available slotinfo or -1 if nothing is available.
func (*FreeLogicalSlotPage) FreeSlotCount ¶
func (flsp *FreeLogicalSlotPage) FreeSlotCount() uint16
FreeSlotCount returns the number of free slots on this page.
func (*FreeLogicalSlotPage) MaxSlots ¶
func (flsp *FreeLogicalSlotPage) MaxSlots() uint16
MaxSlots returns the maximum number of slots which can be allocated.
func (*FreeLogicalSlotPage) ReleaseSlotInfo ¶
func (flsp *FreeLogicalSlotPage) ReleaseSlotInfo(slotinfo uint16) uint16
ReleaseSlotInfo releases a place for a slotinfo and return its offset.
func (*FreeLogicalSlotPage) SlotInfoLocation ¶
func (flsp *FreeLogicalSlotPage) SlotInfoLocation(slotinfo uint16) uint64
SlotInfoLocation returns contents of a stored slotinfo as a location. Lookup is via a given slotinfo id.
type FreePhysicalSlotPage ¶
type FreePhysicalSlotPage struct { *SlotInfoPage // contains filtered or unexported fields }
FreePhysicalSlotPage data structure
func NewFreePhysicalSlotPage ¶
func NewFreePhysicalSlotPage(record *file.Record) *FreePhysicalSlotPage
NewFreePhysicalSlotPage creates a new page which can manage free slots.
func (*FreePhysicalSlotPage) AllocateSlotInfo ¶
func (fpsp *FreePhysicalSlotPage) AllocateSlotInfo(slotinfo uint16) uint16
AllocateSlotInfo allocates a place for a slotinfo and returns the offset for it.
func (*FreePhysicalSlotPage) FindSlot ¶
func (fpsp *FreePhysicalSlotPage) FindSlot(minSize uint32) int
FindSlot finds a slot which is suitable for a given amount of data but which is also not too big to avoid wasting space.
func (*FreePhysicalSlotPage) FirstFreeSlotInfo ¶
func (fpsp *FreePhysicalSlotPage) FirstFreeSlotInfo() int
FirstFreeSlotInfo returns the id for the first available slotinfo for allocation or -1 if nothing is available.
func (*FreePhysicalSlotPage) FreeSlotCount ¶
func (fpsp *FreePhysicalSlotPage) FreeSlotCount() uint16
FreeSlotCount returns the number of free slots on this page.
func (*FreePhysicalSlotPage) FreeSlotSize ¶
func (fpsp *FreePhysicalSlotPage) FreeSlotSize(offset uint16) uint32
FreeSlotSize returns the size of a free slot. Lookup is via offset.
func (*FreePhysicalSlotPage) MaxSlots ¶
func (fpsp *FreePhysicalSlotPage) MaxSlots() uint16
MaxSlots returns the maximum number of slots which can be allocated.
func (*FreePhysicalSlotPage) ReleaseSlotInfo ¶
func (fpsp *FreePhysicalSlotPage) ReleaseSlotInfo(slotinfo uint16) uint16
ReleaseSlotInfo releases a place for a slotinfo and return its offset.
func (*FreePhysicalSlotPage) SetFreeSlotSize ¶
func (fpsp *FreePhysicalSlotPage) SetFreeSlotSize(offset uint16, size uint32)
SetFreeSlotSize sets the size of a free slot. Lookup is via offset.
func (*FreePhysicalSlotPage) SlotInfoLocation ¶
func (fpsp *FreePhysicalSlotPage) SlotInfoLocation(slotinfo uint16) uint64
SlotInfoLocation returns contents of a stored slotinfo as a location. Lookup is via a given slotinfo id.
type SlotInfoPage ¶
SlotInfoPage data structure
func NewSlotInfoPage ¶
func NewSlotInfoPage(record *file.Record) *SlotInfoPage
NewSlotInfoPage creates a new SlotInfoPage object which can manage slotinfos.
func (*SlotInfoPage) SetSlotInfo ¶
func (lm *SlotInfoPage) SetSlotInfo(slotinfoOffset uint16, recordID uint64, offset uint16)
SetSlotInfo stores a slotinfo on the pageview's record.
func (*SlotInfoPage) SlotInfoOffset ¶
func (lm *SlotInfoPage) SlotInfoOffset(offset uint16) uint16
SlotInfoOffset gets the record offset of a stored slotinfo.
func (*SlotInfoPage) SlotInfoRecord ¶
func (lm *SlotInfoPage) SlotInfoRecord(offset uint16) uint64
SlotInfoRecord gets record id of a stored slotinfo.