cache

package
v1.2.2-20240715 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MO_OFF           = 2
	MO_ROWID_IDX     = 0
	MO_TIMESTAMP_IDX = 1
)
View Source
const (
	GcBuffer = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogCache

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

catalog cache

func NewCatalog

func NewCatalog() *CatalogCache

func (*CatalogCache) CanServe added in v1.2.0

func (cc *CatalogCache) CanServe(ts types.TS) bool

func (*CatalogCache) Databases

func (cc *CatalogCache) Databases(accountId uint32, ts timestamp.Timestamp) []string

func (*CatalogCache) DeleteDatabase

func (cc *CatalogCache) DeleteDatabase(bat *batch.Batch)

func (*CatalogCache) DeleteTable

func (cc *CatalogCache) DeleteTable(bat *batch.Batch)

func (*CatalogCache) GC

func (cc *CatalogCache) GC(ts timestamp.Timestamp)

func (*CatalogCache) GetDatabase

func (cc *CatalogCache) GetDatabase(db *DatabaseItem) bool

func (*CatalogCache) GetSchemaVersion added in v1.0.0

func (cc *CatalogCache) GetSchemaVersion(name TableKey) *TableVersion

GetSchemaVersion returns the version of table

func (*CatalogCache) GetTable

func (cc *CatalogCache) GetTable(tbl *TableItem) bool

func (*CatalogCache) GetTableById added in v0.8.0

func (cc *CatalogCache) GetTableById(databaseId, tblId uint64) *TableItem

func (*CatalogCache) GetTableByName added in v1.2.0

func (cc *CatalogCache) GetTableByName(databaseID uint64, tableName string) *TableItem

GetTableByName returns the table item whose name is tableName in the database.

func (*CatalogCache) InsertColumns

func (cc *CatalogCache) InsertColumns(bat *batch.Batch)

func (*CatalogCache) InsertDatabase

func (cc *CatalogCache) InsertDatabase(bat *batch.Batch)

func (*CatalogCache) InsertTable

func (cc *CatalogCache) InsertTable(bat *batch.Batch)

func (*CatalogCache) Tables

func (cc *CatalogCache) Tables(accountId uint32, databaseId uint64,
	ts timestamp.Timestamp) ([]string, []uint64)

func (*CatalogCache) UpdateDuration added in v1.2.0

func (cc *CatalogCache) UpdateDuration(start types.TS, end types.TS)

func (*CatalogCache) UpdateStart added in v1.2.0

func (cc *CatalogCache) UpdateStart(ts types.TS)

type DatabaseItem

type DatabaseItem struct {
	// database key
	AccountId uint32
	Name      string
	Ts        timestamp.Timestamp

	// database value
	Id        uint64
	Rowid     types.Rowid
	Typ       string
	CreateSql string
	// contains filtered or unexported fields
}

type TableItem

type TableItem struct {
	// table key
	AccountId  uint32
	DatabaseId uint64
	Name       string
	Ts         timestamp.Timestamp

	// table value
	Id       uint64
	TableDef *plan.TableDef
	Defs     []engine.TableDef
	Rowid    types.Rowid
	Version  uint32
	/*
		Rowids in mo_columns from replayed logtail.

		CORNER CASE:
		create table t1(a int);
		begin;
		drop table t1;
		show tables; //no table t1. no item for t1 in mo_columns also.
	*/
	Rowids []types.Rowid

	// table def
	Kind           string
	ViewDef        string
	Constraint     []byte
	Comment        string
	Partitioned    int8
	Partition      string
	CreateSql      string
	CatalogVersion uint32

	// primary index
	PrimaryIdx    int
	PrimarySeqnum int
	// clusterBy key
	ClusterByIdx int
	// contains filtered or unexported fields
}

type TableKey added in v1.0.0

type TableKey struct {
	AccountId  uint32
	DatabaseId uint64
	Name       string
}

type TableVersion added in v1.0.0

type TableVersion struct {
	Version uint32
	Ts      *timestamp.Timestamp
	TableId uint64
}

Jump to

Keyboard shortcuts

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