Documentation ¶
Index ¶
- Variables
- type Meta
- func (m *Meta) AddHistoryBgJob(job *model.Job) error
- func (m *Meta) AddHistoryDDLJob(job *model.Job) error
- func (m *Meta) BgJobQueueLen() (int64, error)
- func (m *Meta) CreateDatabase(dbInfo *model.DBInfo) error
- func (m *Meta) CreateTable(dbID int64, tableInfo *model.TableInfo) error
- func (m *Meta) DDLJobQueueLen() (int64, error)
- func (m *Meta) DeQueueBgJob() (*model.Job, error)
- func (m *Meta) DeQueueDDLJob() (*model.Job, error)
- func (m *Meta) DropDatabase(dbID int64) error
- func (m *Meta) DropTable(dbID int64, tableID int64) error
- func (m *Meta) EnQueueBgJob(job *model.Job) error
- func (m *Meta) EnQueueDDLJob(job *model.Job) error
- func (m *Meta) FinishBootstrap() error
- func (m *Meta) GenAutoTableID(dbID int64, tableID int64, step int64) (int64, error)
- func (m *Meta) GenGlobalID() (int64, error)
- func (m *Meta) GenSchemaVersion() (int64, error)
- func (m *Meta) GetAutoTableID(dbID int64, tableID int64) (int64, error)
- func (m *Meta) GetBgJob(index int64) (*model.Job, error)
- func (m *Meta) GetBgJobOwner() (*model.Owner, error)
- func (m *Meta) GetDDLJob(index int64) (*model.Job, error)
- func (m *Meta) GetDDLJobOwner() (*model.Owner, error)
- func (m *Meta) GetDDLReorgHandle(job *model.Job) (int64, error)
- func (m *Meta) GetDatabase(dbID int64) (*model.DBInfo, error)
- func (m *Meta) GetGlobalID() (int64, error)
- func (m *Meta) GetHistoryBgJob(id int64) (*model.Job, error)
- func (m *Meta) GetHistoryDDLJob(id int64) (*model.Job, error)
- func (m *Meta) GetSchemaVersion() (int64, error)
- func (m *Meta) GetTable(dbID int64, tableID int64) (*model.TableInfo, error)
- func (m *Meta) IsBootstrapped() (bool, error)
- func (m *Meta) ListDatabases() ([]*model.DBInfo, error)
- func (m *Meta) ListTables(dbID int64) ([]*model.TableInfo, error)
- func (m *Meta) RemoveDDLReorgHandle(job *model.Job) error
- func (m *Meta) SetBgJobOwner(o *model.Owner) error
- func (m *Meta) SetDDLJobOwner(o *model.Owner) error
- func (m *Meta) UpdateBgJob(index int64, job *model.Job) error
- func (m *Meta) UpdateDDLJob(index int64, job *model.Job) error
- func (m *Meta) UpdateDDLReorgHandle(job *model.Job, handle int64) error
- func (m *Meta) UpdateDatabase(dbInfo *model.DBInfo) error
- func (m *Meta) UpdateTable(dbID int64, tableInfo *model.TableInfo) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDBExists is the error for db exists. ErrDBExists = terror.ClassMeta.New(codeDatabaseExists, "database already exists") // ErrDBNotExists is the error for db not exists. ErrDBNotExists = terror.ClassMeta.New(codeDatabaseNotExists, "database doesn't exist") // ErrTableExists is the error for table exists. ErrTableExists = terror.ClassMeta.New(codeTableExists, "table already exists") // ErrTableNotExists is the error for table not exists. ErrTableNotExists = terror.ClassMeta.New(codeTableNotExists, "table doesn't exist") )
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct {
// contains filtered or unexported fields
}
Meta is for handling meta information in a transaction.
func (*Meta) AddHistoryBgJob ¶
AddHistoryBgJob adds background job to history.
func (*Meta) AddHistoryDDLJob ¶
AddHistoryDDLJob adds DDL job to history.
func (*Meta) BgJobQueueLen ¶
BgJobQueueLen returns the background job queue length.
func (*Meta) CreateDatabase ¶
CreateDatabase creates a database with db info.
func (*Meta) CreateTable ¶
CreateTable creates a table with tableInfo in database.
func (*Meta) DDLJobQueueLen ¶
DDLJobQueueLen returns the DDL job queue length.
func (*Meta) DeQueueBgJob ¶
DeQueueBgJob pops a background job from the list.
func (*Meta) DeQueueDDLJob ¶
DeQueueDDLJob pops a DDL job from the list.
func (*Meta) DropDatabase ¶
DropDatabase drops whole database.
func (*Meta) EnQueueBgJob ¶
EnQueueBgJob adds a background job to the list.
func (*Meta) EnQueueDDLJob ¶
EnQueueDDLJob adds a DDL job to the list.
func (*Meta) FinishBootstrap ¶
FinishBootstrap finishes bootstrap.
func (*Meta) GenAutoTableID ¶
GenAutoTableID adds step to the auto id of the table and returns the sum.
func (*Meta) GenGlobalID ¶
GenGlobalID generates next id globally.
func (*Meta) GenSchemaVersion ¶
GenSchemaVersion generates next schema version.
func (*Meta) GetAutoTableID ¶
GetAutoTableID gets current auto id with table id.
func (*Meta) GetBgJobOwner ¶
GetBgJobOwner gets the current background job owner.
func (*Meta) GetDDLJobOwner ¶
GetDDLJobOwner gets the current owner for DDL.
func (*Meta) GetDDLReorgHandle ¶
GetDDLReorgHandle gets the latest processed handle.
func (*Meta) GetDatabase ¶
GetDatabase gets the database value with ID.
func (*Meta) GetGlobalID ¶
GetGlobalID gets current global id.
func (*Meta) GetHistoryBgJob ¶
GetHistoryBgJob gets a history background job.
func (*Meta) GetHistoryDDLJob ¶
GetHistoryDDLJob gets a history DDL job.
func (*Meta) GetSchemaVersion ¶
GetSchemaVersion gets current global schema version.
func (*Meta) IsBootstrapped ¶
IsBootstrapped returns whether we have already run bootstrap or not. return true means we don't need doing any other bootstrap.
func (*Meta) ListDatabases ¶
ListDatabases shows all databases.
func (*Meta) ListTables ¶
ListTables shows all tables in database.
func (*Meta) RemoveDDLReorgHandle ¶
RemoveDDLReorgHandle removes the job reorganization handle.
func (*Meta) SetBgJobOwner ¶
SetBgJobOwner sets the current background job owner.
func (*Meta) SetDDLJobOwner ¶
SetDDLJobOwner sets the current owner for DDL.
func (*Meta) UpdateBgJob ¶
UpdateBgJob updates the background job with index.
func (*Meta) UpdateDDLJob ¶
UpdateDDLJob updates the DDL job with index.
func (*Meta) UpdateDDLReorgHandle ¶
UpdateDDLReorgHandle saves the job reorganization latest processed handle for later resuming.
func (*Meta) UpdateDatabase ¶
UpdateDatabase updates a database with db info.