meta

package
v0.0.0-...-40faf7d Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewMeta

func NewMeta(txn kv.Transaction) *Meta

NewMeta creates a Meta in transaction txn.

func NewSnapshotMeta

func NewSnapshotMeta(snapshot kv.Snapshot) *Meta

NewSnapshotMeta creates a Meta with snapshot.

func (*Meta) AddHistoryBgJob

func (m *Meta) AddHistoryBgJob(job *model.Job) error

AddHistoryBgJob adds background job to history.

func (*Meta) AddHistoryDDLJob

func (m *Meta) AddHistoryDDLJob(job *model.Job) error

AddHistoryDDLJob adds DDL job to history.

func (*Meta) BgJobQueueLen

func (m *Meta) BgJobQueueLen() (int64, error)

BgJobQueueLen returns the background job queue length.

func (*Meta) CreateDatabase

func (m *Meta) CreateDatabase(dbInfo *model.DBInfo) error

CreateDatabase creates a database with db info.

func (*Meta) CreateTable

func (m *Meta) CreateTable(dbID int64, tableInfo *model.TableInfo) error

CreateTable creates a table with tableInfo in database.

func (*Meta) DDLJobQueueLen

func (m *Meta) DDLJobQueueLen() (int64, error)

DDLJobQueueLen returns the DDL job queue length.

func (*Meta) DeQueueBgJob

func (m *Meta) DeQueueBgJob() (*model.Job, error)

DeQueueBgJob pops a background job from the list.

func (*Meta) DeQueueDDLJob

func (m *Meta) DeQueueDDLJob() (*model.Job, error)

DeQueueDDLJob pops a DDL job from the list.

func (*Meta) DropDatabase

func (m *Meta) DropDatabase(dbID int64) error

DropDatabase drops whole database.

func (*Meta) DropTable

func (m *Meta) DropTable(dbID int64, tableID int64) error

DropTable drops table in database.

func (*Meta) EnQueueBgJob

func (m *Meta) EnQueueBgJob(job *model.Job) error

EnQueueBgJob adds a background job to the list.

func (*Meta) EnQueueDDLJob

func (m *Meta) EnQueueDDLJob(job *model.Job) error

EnQueueDDLJob adds a DDL job to the list.

func (*Meta) FinishBootstrap

func (m *Meta) FinishBootstrap(version int64) error

FinishBootstrap finishes bootstrap.

func (*Meta) GenAutoTableID

func (m *Meta) GenAutoTableID(dbID int64, tableID int64, step int64) (int64, error)

GenAutoTableID adds step to the auto id of the table and returns the sum.

func (*Meta) GenGlobalID

func (m *Meta) GenGlobalID() (int64, error)

GenGlobalID generates next id globally.

func (*Meta) GenSchemaVersion

func (m *Meta) GenSchemaVersion() (int64, error)

GenSchemaVersion generates next schema version.

func (*Meta) GetAllHistoryDDLJobs

func (m *Meta) GetAllHistoryDDLJobs() ([]*model.Job, error)

GetAllHistoryDDLJobs gets all history DDL jobs.

func (*Meta) GetAutoTableID

func (m *Meta) GetAutoTableID(dbID int64, tableID int64) (int64, error)

GetAutoTableID gets current auto id with table id.

func (*Meta) GetBgJob

func (m *Meta) GetBgJob(index int64) (*model.Job, error)

GetBgJob returns the background job with index.

func (*Meta) GetBgJobOwner

func (m *Meta) GetBgJobOwner() (*model.Owner, error)

GetBgJobOwner gets the current background job owner.

func (*Meta) GetBootstrapVersion

func (m *Meta) GetBootstrapVersion() (int64, error)

GetBootstrapVersion returns the version of the server which boostrap the store. If the store is not bootstraped, the version will be zero.

func (*Meta) GetDDLJob

func (m *Meta) GetDDLJob(index int64) (*model.Job, error)

GetDDLJob returns the DDL job with index.

func (*Meta) GetDDLJobOwner

func (m *Meta) GetDDLJobOwner() (*model.Owner, error)

GetDDLJobOwner gets the current owner for DDL.

func (*Meta) GetDDLReorgHandle

func (m *Meta) GetDDLReorgHandle(job *model.Job) (int64, error)

GetDDLReorgHandle gets the latest processed handle.

func (*Meta) GetDatabase

func (m *Meta) GetDatabase(dbID int64) (*model.DBInfo, error)

GetDatabase gets the database value with ID.

func (*Meta) GetGlobalID

func (m *Meta) GetGlobalID() (int64, error)

GetGlobalID gets current global id.

func (*Meta) GetHistoryBgJob

func (m *Meta) GetHistoryBgJob(id int64) (*model.Job, error)

GetHistoryBgJob gets a history background job.

func (*Meta) GetHistoryDDLJob

func (m *Meta) GetHistoryDDLJob(id int64) (*model.Job, error)

GetHistoryDDLJob gets a history DDL job.

func (*Meta) GetSchemaDiff

func (m *Meta) GetSchemaDiff(schemaVersion int64) (*model.SchemaDiff, error)

GetSchemaDiff gets the modification information on a given schema version.

func (*Meta) GetSchemaVersion

func (m *Meta) GetSchemaVersion() (int64, error)

GetSchemaVersion gets current global schema version.

func (*Meta) GetTable

func (m *Meta) GetTable(dbID int64, tableID int64) (*model.TableInfo, error)

GetTable gets the table value in database with tableID.

func (*Meta) GetTableStats

func (m *Meta) GetTableStats(tableID int64) (*statistics.TablePB, error)

GetTableStats gets table statistics.

func (*Meta) ListDatabases

func (m *Meta) ListDatabases() ([]*model.DBInfo, error)

ListDatabases shows all databases.

func (*Meta) ListTables

func (m *Meta) ListTables(dbID int64) ([]*model.TableInfo, error)

ListTables shows all tables in database.

func (*Meta) RemoveDDLReorgHandle

func (m *Meta) RemoveDDLReorgHandle(job *model.Job) error

RemoveDDLReorgHandle removes the job reorganization handle.

func (*Meta) SetBgJobOwner

func (m *Meta) SetBgJobOwner(o *model.Owner) error

SetBgJobOwner sets the current background job owner.

func (*Meta) SetDDLJobOwner

func (m *Meta) SetDDLJobOwner(o *model.Owner) error

SetDDLJobOwner sets the current owner for DDL.

func (*Meta) SetSchemaDiff

func (m *Meta) SetSchemaDiff(schemaVersion int64, diff *model.SchemaDiff) error

SetSchemaDiff sets the modification information on a given schema version.

func (*Meta) SetTableStats

func (m *Meta) SetTableStats(tableID int64, tpb *statistics.TablePB) error

SetTableStats sets table statistics.

func (*Meta) UpdateBgJob

func (m *Meta) UpdateBgJob(index int64, job *model.Job) error

UpdateBgJob updates the background job with index.

func (*Meta) UpdateDDLJob

func (m *Meta) UpdateDDLJob(index int64, job *model.Job) error

UpdateDDLJob updates the DDL job with index.

func (*Meta) UpdateDDLReorgHandle

func (m *Meta) UpdateDDLReorgHandle(job *model.Job, handle int64) error

UpdateDDLReorgHandle saves the job reorganization latest processed handle for later resuming.

func (*Meta) UpdateDatabase

func (m *Meta) UpdateDatabase(dbInfo *model.DBInfo) error

UpdateDatabase updates a database with db info.

func (*Meta) UpdateTable

func (m *Meta) UpdateTable(dbID int64, tableInfo *model.TableInfo) error

UpdateTable updates the table with table info.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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