catalog

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 10 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

TODO: (SDB) need call RecoveryCatalogFromCatalogPage when recovery or database re-launch 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) 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) OID

func (t *TableMetadata) OID() uint32

func (*TableMetadata) Schema

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

func (*TableMetadata) Table

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

Jump to

Keyboard shortcuts

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