Documentation
¶
Index ¶
- Constants
- func ColumnsCatalogSchema() *schema.Schema
- func Int32toBool(val int32) bool
- func TableCatalogSchema() *schema.Schema
- type Catalog
- func (c *Catalog) CreateTable(name string, schema *schema.Schema, txn *access.Transaction) *TableMetadata
- func (c *Catalog) GetAllTables() []*TableMetadata
- func (c *Catalog) GetColValFromTupleForRollback(tuple_ *tuple.Tuple, colIdx uint32, oid uint32) *types.Value
- func (c *Catalog) GetRollbackNeededIndexes(indexMap map[uint32][]index.Index, oid uint32) []index.Index
- func (c *Catalog) GetTableByName(table string) *TableMetadata
- func (c *Catalog) GetTableByOID(oid uint32) *TableMetadata
- type TableMetadata
Constants ¶
const ColumnsCatalogOID = 0
const ColumnsCatalogPageId = 1
ColumnsCatalogPageId indicates the page where the columns catalog can be found The second page is reserved for the table catalog
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 Int32toBool ¶
func TableCatalogSchema ¶
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 (*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 (*TableMetadata) GetColumnNum ¶
func (t *TableMetadata) GetColumnNum() uint32
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