page

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const COLUMN_NAME_LIMT = 2048
View Source
const INVALID_PAGE_ID = 4294967295
View Source
const PAGE_SIZE = 4096
View Source
const SLOT_ID_SIZE = 4
View Source
const SLOT_OFFSET = 24
View Source
const SLOT_SIZE = 6
View Source
const TABLE_NAME_LIMT = 2048
View Source
const TUPLE_LOCATION_SIZE = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page interface {
	Init()
	GetData() []byte
	GetPageId() uint32
	SetData([]byte) error
	SetPageId(page_id uint32)
	IsDirty() bool
	SetDirtyBit(val bool)
}

func InvalidPage

func InvalidPage() Page

type PageImpl

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

func (*PageImpl) GetData

func (p *PageImpl) GetData() []byte

func (*PageImpl) GetPageId

func (p *PageImpl) GetPageId() uint32

func (*PageImpl) Init

func (p *PageImpl) Init()

func (*PageImpl) IsDirty

func (p *PageImpl) IsDirty() bool

func (*PageImpl) ResetMemory

func (p *PageImpl) ResetMemory() error

func (*PageImpl) SetData

func (p *PageImpl) SetData(d []byte) error

func (*PageImpl) SetDirtyBit

func (p *PageImpl) SetDirtyBit(val bool)

func (*PageImpl) SetPageId

func (p *PageImpl) SetPageId(page_id uint32)

type SchemaPage

type SchemaPage struct {
	PageImpl
}

func (*SchemaPage) GetFreeSpacePointer

func (sp *SchemaPage) GetFreeSpacePointer() uint16

right now giving it only 2 bytes we have space for more but with 2 byte it means we can only have a page with maxsize 2^16 -> 65535

func (*SchemaPage) GetHeader

func (sp *SchemaPage) GetHeader() []byte

func (*SchemaPage) GetNumberOfTuples

func (sp *SchemaPage) GetNumberOfTuples() uint16

func (*SchemaPage) GetSlotStart

func (sp *SchemaPage) GetSlotStart(i uint16) uint16

func (*SchemaPage) Init

func (sp *SchemaPage) Init()

func (*SchemaPage) InsertTuple

func (sp *SchemaPage) InsertTuple(tp Tuple) error

func (*SchemaPage) ReadTuple

func (sp *SchemaPage) ReadTuple(i uint16) []byte

func (*SchemaPage) SetFreeSpacePointer

func (sp *SchemaPage) SetFreeSpacePointer(fsp uint16) error

probably should be private

func (*SchemaPage) UpdateNumberOfTuples

func (sp *SchemaPage) UpdateNumberOfTuples(fsp uint16) error

type Tuple

type Tuple interface {
	ReadTuple(data_ []byte)
	SetValueFor(column_i uint64, val interface{})
	GetValueFor(column_i uint64) interface{}
	GetSize() uint64
	GetData() []byte
	PrintTuple()
}

type TupleImpl

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

func (*TupleImpl) GetData

func (st *TupleImpl) GetData() []byte

func (*TupleImpl) GetSize

func (st *TupleImpl) GetSize() uint64

func (*TupleImpl) GetValueFor

func (st *TupleImpl) GetValueFor(column_i uint64) interface{}

func (*TupleImpl) Init

func (st *TupleImpl) Init(s_ []string)

func (*TupleImpl) PrintTuple

func (st *TupleImpl) PrintTuple()

func (*TupleImpl) ReadTuple

func (st *TupleImpl) ReadTuple(data_ []byte)

func (*TupleImpl) SetValueFor

func (st *TupleImpl) SetValueFor(column_i uint64, val interface{})

Jump to

Keyboard shortcuts

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