Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeIndexInfoRow(row *common.Row) *common.IndexInfo
- func DecodeInternalTableInfoRow(row *common.Row) *common.InternalTableInfo
- func DecodeMaterializedViewInfoRow(row *common.Row) *common.MaterializedViewInfo
- func DecodeSourceInfoRow(row *common.Row) *common.SourceInfo
- func EncodeIndexInfoToRow(info *common.IndexInfo) *common.Row
- func EncodeInternalTableInfoToRow(info *common.InternalTableInfo) *common.Row
- func EncodeMaterializedViewInfoToRow(info *common.MaterializedViewInfo) *common.Row
- func EncodeSourceInfoToRow(info *common.SourceInfo) *common.Row
- type Controller
- func (c *Controller) DeleteEntityWithID(tableID uint64) error
- func (c *Controller) DeleteIndex(indexID uint64) error
- func (c *Controller) DeleteMaterializedView(mvInfo *common.MaterializedViewInfo, ...) error
- func (c *Controller) DeleteSchemaIfEmpty(schema *common.Schema)
- func (c *Controller) DeleteSource(sourceID uint64) error
- func (c *Controller) ExistsMvOrSource(schema *common.Schema, name string) error
- func (c *Controller) GetIndex(schemaName string, tableName string, indexName string) (*common.IndexInfo, bool)
- func (c *Controller) GetMaterializedView(schemaName string, name string) (*common.MaterializedViewInfo, bool)
- func (c *Controller) GetOrCreateSchema(schemaName string) *common.Schema
- func (c *Controller) GetSchema(schemaName string) (schema *common.Schema, ok bool)
- func (c *Controller) GetSchemaNames() []string
- func (c *Controller) GetSource(schemaName string, name string) (*common.SourceInfo, bool)
- func (c *Controller) PersistIndex(indexInfo *common.IndexInfo) error
- func (c *Controller) PersistMaterializedView(mvInfo *common.MaterializedViewInfo, ...) error
- func (c *Controller) PersistSource(sourceInfo *common.SourceInfo) error
- func (c *Controller) RegisterIndex(indexInfo *common.IndexInfo) error
- func (c *Controller) RegisterMaterializedView(mvInfo *common.MaterializedViewInfo, ...) error
- func (c *Controller) RegisterSource(sourceInfo *common.SourceInfo) error
- func (c *Controller) Start() error
- func (c *Controller) Stop() error
- func (c *Controller) UnregisterIndex(schemaName string, tableName string, indexName string) error
- func (c *Controller) UnregisterMaterializedView(schemaName string, mvName string, internalTables []string) error
- func (c *Controller) UnregisterSource(schemaName string, sourceName string) error
Constants ¶
const ( TableKindSource = "source" TableKindMaterializedView = "materialized_view" TableKindInternal = "internal" )
const ( // SystemSchemaName is the name of the schema that houses system tables, similar to mysql's information_schema. SystemSchemaName = "sys" // TableDefTableName is the name of the table that holds all table definitions. TableDefTableName = "tables" IndexDefTableName = "indexes" ProtobufTableName = "protos" DummyTableName = "dummy" )
Variables ¶
var DummyTableInfo = &common.MetaTableInfo{TableInfo: common.NewTableInfo( common.DummyTableID, SystemSchemaName, DummyTableName, []int{0}, []string{"x"}, []common.ColumnType{ common.BigIntColumnType, })}
DummyTableInfo - Dummy is a simple table that we execute a query against at startup to ensure all shards are available
var IndexDefTableInfo = &common.MetaTableInfo{TableInfo: common.NewTableInfo( common.IndexTableID, SystemSchemaName, IndexDefTableName, []int{0}, []string{"id", "schema_name", "name", "index_info", "table_name"}, []common.ColumnType{ common.BigIntColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, })}
var ProtobufTableInfo = &common.MetaTableInfo{TableInfo: common.NewTableInfo( common.ProtobufTableID, SystemSchemaName, ProtobufTableName, []int{0}, []string{"path", "fd"}, []common.ColumnType{ common.VarcharColumnType, common.VarcharColumnType, })}
ProtobufTableInfo is a static definition of the table schema for the table schema table.
var TableDefTableInfo = &common.MetaTableInfo{TableInfo: common.NewTableInfo( common.SchemaTableID, SystemSchemaName, TableDefTableName, []int{0}, []string{"id", "kind", "schema_name", "name", "table_info", "topic_info", "query", "mv_name"}, []common.ColumnType{ common.BigIntColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, common.VarcharColumnType, })}
TableDefTableInfo is a static definition of the table schema for the table schema table.
Functions ¶
func DecodeIndexInfoRow ¶
DecodeIndexInfoRow decodes a database row into a common.IndexInfo.
func DecodeInternalTableInfoRow ¶
func DecodeInternalTableInfoRow(row *common.Row) *common.InternalTableInfo
DecodeInternalTableInfoRow decodes a database row into a common.InternalTableInfo.
func DecodeMaterializedViewInfoRow ¶
func DecodeMaterializedViewInfoRow(row *common.Row) *common.MaterializedViewInfo
DecodeMaterializedViewInfoRow decodes a database row into a common.MaterializedViewInfo.
func DecodeSourceInfoRow ¶
func DecodeSourceInfoRow(row *common.Row) *common.SourceInfo
DecodeSourceInfoRow decodes a database row into a common.SourceInfo.
func EncodeIndexInfoToRow ¶
EncodeIndexInfoToRow encodes a common.IndexInfo into a database row.
func EncodeInternalTableInfoToRow ¶
func EncodeInternalTableInfoToRow(info *common.InternalTableInfo) *common.Row
EncodeInternalTableInfoToRow encodes a common.InternalTableInfo into a database row.
func EncodeMaterializedViewInfoToRow ¶
func EncodeMaterializedViewInfoToRow(info *common.MaterializedViewInfo) *common.Row
EncodeMaterializedViewInfoToRow encodes a common.MaterializedViewInfo into a database row.
func EncodeSourceInfoToRow ¶
func EncodeSourceInfoToRow(info *common.SourceInfo) *common.Row
EncodeSourceInfoToRow encodes a common.SourceInfo into a database row.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(store cluster.Cluster) *Controller
func (*Controller) DeleteEntityWithID ¶
func (c *Controller) DeleteEntityWithID(tableID uint64) error
func (*Controller) DeleteIndex ¶
func (c *Controller) DeleteIndex(indexID uint64) error
func (*Controller) DeleteMaterializedView ¶
func (c *Controller) DeleteMaterializedView(mvInfo *common.MaterializedViewInfo, internalTableIDs []*common.InternalTableInfo) error
func (*Controller) DeleteSchemaIfEmpty ¶
func (c *Controller) DeleteSchemaIfEmpty(schema *common.Schema)
DeleteSchemaIfEmpty - Schema are removed once they have no more tables
func (*Controller) DeleteSource ¶
func (c *Controller) DeleteSource(sourceID uint64) error
func (*Controller) ExistsMvOrSource ¶
func (c *Controller) ExistsMvOrSource(schema *common.Schema, name string) error
func (*Controller) GetMaterializedView ¶
func (c *Controller) GetMaterializedView(schemaName string, name string) (*common.MaterializedViewInfo, bool)
func (*Controller) GetOrCreateSchema ¶
func (c *Controller) GetOrCreateSchema(schemaName string) *common.Schema
func (*Controller) GetSchema ¶
func (c *Controller) GetSchema(schemaName string) (schema *common.Schema, ok bool)
func (*Controller) GetSchemaNames ¶
func (c *Controller) GetSchemaNames() []string
func (*Controller) GetSource ¶
func (c *Controller) GetSource(schemaName string, name string) (*common.SourceInfo, bool)
func (*Controller) PersistIndex ¶
func (c *Controller) PersistIndex(indexInfo *common.IndexInfo) error
func (*Controller) PersistMaterializedView ¶
func (c *Controller) PersistMaterializedView(mvInfo *common.MaterializedViewInfo, internalTables []*common.InternalTableInfo) error
func (*Controller) PersistSource ¶
func (c *Controller) PersistSource(sourceInfo *common.SourceInfo) error
func (*Controller) RegisterIndex ¶
func (c *Controller) RegisterIndex(indexInfo *common.IndexInfo) error
RegisterIndex adds an index to the metadata controller, making it active. It does not persist it
func (*Controller) RegisterMaterializedView ¶
func (c *Controller) RegisterMaterializedView(mvInfo *common.MaterializedViewInfo, internalTables []*common.InternalTableInfo) error
func (*Controller) RegisterSource ¶
func (c *Controller) RegisterSource(sourceInfo *common.SourceInfo) error
RegisterSource adds a Source to the metadata controller, making it active. It does not persist it
func (*Controller) Start ¶
func (c *Controller) Start() error
func (*Controller) Stop ¶
func (c *Controller) Stop() error
func (*Controller) UnregisterIndex ¶
func (c *Controller) UnregisterIndex(schemaName string, tableName string, indexName string) error
UnregisterIndex removes the index from memory but does not delete it from storage
func (*Controller) UnregisterMaterializedView ¶
func (c *Controller) UnregisterMaterializedView(schemaName string, mvName string, internalTables []string) error
func (*Controller) UnregisterSource ¶
func (c *Controller) UnregisterSource(schemaName string, sourceName string) error
UnregisterSource removes the source from memory but does not delete it from storage