catalog

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ColumnsCatalogOID = 0
View Source
const ColumnsCatalogPageId = 1

ColumnsCatalogPageId indicates the page where the columns catalog can be found The second page is reserved for the table catalog

View Source
const TableCatalogPageId = 0

TableCatalogPageId indicates the page where the table catalog can be found The first page is reserved for the table catalog

Variables

This section is empty.

Functions

func ColumnsCatalogSchema

func ColumnsCatalogSchema() *schema.Schema

func Int32toBool

func Int32toBool(val int32) bool

func TableCatalogSchema

func TableCatalogSchema() *schema.Schema

Types

type Catalog

type Catalog struct {
	Log_manager  *recovery.LogManager
	Lock_manager *access.LockManager
	// contains filtered or unexported fields
}

Catalog is a non-persistent catalog that is designed for the executor to use. It handles table creation and table lookup

func BootstrapCatalog

func BootstrapCatalog(bpm *buffer.BufferPoolManager, log_manager *recovery.LogManager, lock_manager *access.LockManager, txn *access.Transaction) *Catalog

BootstrapCatalog bootstrap the systems' catalogs on the first database initialization

func RecoveryCatalogFromCatalogPage

func RecoveryCatalogFromCatalogPage(bpm *buffer.BufferPoolManager, log_manager *recovery.LogManager, lock_manager *access.LockManager, txn *access.Transaction) *Catalog

RecoveryCatalogFromCatalogPage get all information about tables and columns from disk and put it on memory

func (*Catalog) CreateTable

func (c *Catalog) CreateTable(name string, schema *schema.Schema, txn *access.Transaction) *TableMetadata

CreateTable creates a new table and return its metadata

func (*Catalog) GetAllTables added in v0.0.2

func (c *Catalog) GetAllTables() []*TableMetadata

func (*Catalog) GetColValFromTupleForRollback added in v0.0.2

func (c *Catalog) GetColValFromTupleForRollback(tuple_ *tuple.Tuple, colIdx uint32, oid uint32) *types.Value

func (*Catalog) GetRollbackNeededIndexes added in v0.0.2

func (c *Catalog) GetRollbackNeededIndexes(indexMap map[uint32][]index.Index, oid uint32) []index.Index

for Redo/Undo

returned list's length is same with column num of table. value of elements corresponding to columns which doesn't have index is nil.

func (*Catalog) GetTableByName

func (c *Catalog) GetTableByName(table string) *TableMetadata

func (*Catalog) GetTableByOID

func (c *Catalog) GetTableByOID(oid uint32) *TableMetadata

type TableMetadata

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

func NewTableMetadata

func NewTableMetadata(schema *schema.Schema, name string, table *access.TableHeap, oid uint32) *TableMetadata

func (*TableMetadata) GetColumnNum

func (t *TableMetadata) GetColumnNum() uint32

func (*TableMetadata) GetIndex

func (t *TableMetadata) GetIndex(colIndex int) index.Index

func (*TableMetadata) Indexes added in v0.0.2

func (t *TableMetadata) Indexes() []index.Index

return list of indexes ATTENTION: returned list's length is same with column num of table.

value of elements corresponding to columns which doesn't have index is nil

func (*TableMetadata) OID

func (t *TableMetadata) OID() uint32

func (*TableMetadata) Schema

func (t *TableMetadata) Schema() *schema.Schema

func (*TableMetadata) Table

func (t *TableMetadata) Table() *access.TableHeap

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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