Documentation
¶
Index ¶
- Constants
- func InitTableItemWithColumns(item *TableItem, cols Columns)
- func ParseColumnsBatchAnd(bat *batch.Batch, f func(map[TableItemKey]Columns))
- func ParseDatabaseBatchAnd(bat *batch.Batch, f func(*DatabaseItem))
- func ParseTablesBatchAnd(bat *batch.Batch, f func(*TableItem))
- type CatalogCache
- func (cc *CatalogCache) CanServe(ts types.TS) bool
- func (cc *CatalogCache) Databases(accountId uint32, ts timestamp.Timestamp) []string
- func (cc *CatalogCache) DeleteDatabase(bat *batch.Batch)
- func (cc *CatalogCache) DeleteTable(bat *batch.Batch)
- func (cc *CatalogCache) GC(ts timestamp.Timestamp) GCReport
- func (cc *CatalogCache) GetDatabase(db *DatabaseItem) bool
- func (cc *CatalogCache) GetStartTS() types.TS
- func (cc *CatalogCache) GetTable(tbl *TableItem) bool
- func (cc *CatalogCache) GetTableById(aid uint32, databaseId, tblId uint64) *TableItem
- func (cc *CatalogCache) GetTableByIdAndTime(accountID uint32, databaseId, tblId uint64, ts timestamp.Timestamp) *TableItem
- func (cc *CatalogCache) GetTableByName(aid uint32, databaseID uint64, tableName string) *TableItem
- func (cc *CatalogCache) HasNewerVersion(qry *TableChangeQuery) bool
- func (cc *CatalogCache) InsertColumns(bat *batch.Batch)
- func (cc *CatalogCache) InsertDatabase(bat *batch.Batch)
- func (cc *CatalogCache) InsertTable(bat *batch.Batch)
- func (cc *CatalogCache) Tables(accountId uint32, databaseId uint64, ts timestamp.Timestamp) ([]string, []uint64)
- func (cc *CatalogCache) UpdateDuration(start types.TS, end types.TS)
- func (cc *CatalogCache) UpdateStart(ts types.TS)
- type Columns
- type DatabaseItem
- type GCReport
- type TableChangeQuery
- type TableItem
- type TableItemKey
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 ¶
func ParseColumnsBatchAnd ¶
func ParseColumnsBatchAnd(bat *batch.Batch, f func(map[TableItemKey]Columns))
func ParseDatabaseBatchAnd ¶
func ParseDatabaseBatchAnd(bat *batch.Batch, f func(*DatabaseItem))
func ParseTablesBatchAnd ¶
Types ¶
type CatalogCache ¶
type CatalogCache struct {
// contains filtered or unexported fields
}
catalog cache
func NewCatalog ¶
func NewCatalog() *CatalogCache
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) GetDatabase ¶
func (cc *CatalogCache) GetDatabase(db *DatabaseItem) bool
func (*CatalogCache) GetStartTS ¶
func (cc *CatalogCache) GetStartTS() types.TS
func (*CatalogCache) GetTable ¶
func (cc *CatalogCache) GetTable(tbl *TableItem) bool
func (*CatalogCache) GetTableById ¶ added in v0.8.0
func (cc *CatalogCache) GetTableById(aid uint32, databaseId, tblId uint64) *TableItem
GetTableById's complexicity is O(n), where n is the number of all items of the database.
func (*CatalogCache) GetTableByIdAndTime ¶
func (cc *CatalogCache) GetTableByIdAndTime(accountID uint32, databaseId, tblId uint64, ts timestamp.Timestamp) *TableItem
GetTableByIdAndTime's complexicity is O(n), where n is the number of all tables in the database Note: if databaseId is 0, it means the database is not specified. will scan all tables under the account
func (*CatalogCache) GetTableByName ¶ added in v1.2.0
func (cc *CatalogCache) GetTableByName(aid uint32, databaseID uint64, tableName string) *TableItem
GetTableByName's complexicity is O(n), where n is the number of all items of the database.
func (*CatalogCache) HasNewerVersion ¶
func (cc *CatalogCache) HasNewerVersion(qry *TableChangeQuery) bool
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) 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
Typ string
CreateSql string
Rowid types.Rowid
CPKey []byte
// contains filtered or unexported fields
}
func (*DatabaseItem) String ¶
func (item *DatabaseItem) String() string
type TableChangeQuery ¶
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
Version uint32
DatabaseName string
CPKey []byte
// table def
Kind string
ViewDef string
Constraint []byte
Comment string
Partitioned int8
Partition string
CreateSql string
CatalogVersion uint32
ExtraInfo *api.SchemaExtra
// primary index
PrimaryIdx int
PrimarySeqnum int
// clusterBy key
ClusterByIdx int
LogicalId uint64
// contains filtered or unexported fields
}
func (*TableItem) IsIndexTable ¶
func (*TableItem) IsPartitionTable ¶
Click to show internal directories.
Click to hide internal directories.