Documentation ¶
Index ¶
- Constants
- func AddLockedPartitions(sctx sessionctx.Context, tid int64, tableName string, ...) (string, error)
- func AddLockedTables(sctx sessionctx.Context, tables map[int64]*types.StatsLockTable) (string, error)
- func GetLockedTables(tableLocked map[int64]struct{}, tableIDs ...int64) map[int64]struct{}
- func NewStatsLock(pool pkgutil.SessionPool) types.StatsLock
- func QueryLockedTables(ctx context.Context, sctx sessionctx.Context) (map[int64]struct{}, error)
- func RemoveLockedPartitions(sctx sessionctx.Context, tid int64, tableName string, ...) (string, error)
- func RemoveLockedTables(sctx sessionctx.Context, tables map[int64]*types.StatsLockTable) (string, error)
Constants ¶
const (
// DeleteLockSQL is used to delete the locked table record.
DeleteLockSQL = "DELETE FROM mysql.stats_table_locked WHERE table_id = %?"
)
Variables ¶
This section is empty.
Functions ¶
func AddLockedPartitions ¶
func AddLockedPartitions( sctx sessionctx.Context, tid int64, tableName string, pidNames map[int64]string, ) (string, error)
AddLockedPartitions add locked partitions id to store. If the whole table is locked, then skip all partitions of the table. - exec: sql executor. - tid: table id of which will be locked. - tableName: table name of which will be locked. - pidNames: partition ids of which will be locked. Return the message of skipped tables and error.
func AddLockedTables ¶
func AddLockedTables( sctx sessionctx.Context, tables map[int64]*types.StatsLockTable, ) (string, error)
AddLockedTables add locked tables id to store. - exec: sql executor. - tables: tables that will be locked. Return the message of skipped tables and error.
func GetLockedTables ¶
GetLockedTables returns the locked status of the given tables.
func NewStatsLock ¶
func NewStatsLock(pool pkgutil.SessionPool) types.StatsLock
NewStatsLock creates a new StatsLock.
func QueryLockedTables ¶
QueryLockedTables loads locked tables from mysql.stats_table_locked. Return it as a map for fast query.
func RemoveLockedPartitions ¶
func RemoveLockedPartitions( sctx sessionctx.Context, tid int64, tableName string, pidNames map[int64]string, ) (string, error)
RemoveLockedPartitions remove partitions from table locked records. - exec: sql executor. - tid: table id of which will be unlocked. - tableName: table name of which will be unlocked. - pidNames: partition ids of which will be unlocked. Return the message of skipped tables and error.
func RemoveLockedTables ¶
func RemoveLockedTables( sctx sessionctx.Context, tables map[int64]*types.StatsLockTable, ) (string, error)
RemoveLockedTables remove tables from table locked records. - exec: sql executor. - tables: tables of which will be unlocked. Return the message of skipped tables and error.
Types ¶
This section is empty.