Documentation ¶
Index ¶
- Constants
- Variables
- func AutoIncrementIDKey(tableID int64) []byte
- func AutoRandomTableIDKey(tableID int64) []byte
- func AutoTableIDKey(tableID int64) []byte
- func DBkey(dbID int64) []byte
- func DDLJobHistoryKey(m *Meta, jobID int64) []byte
- func DefaultGroupMeta4Test() *model.ResourceGroupInfo
- func IsAutoIncrementIDKey(key []byte) bool
- func IsAutoRandomTableIDKey(key []byte) bool
- func IsAutoTableIDKey(key []byte) bool
- func IsDBkey(dbKey []byte) bool
- func IsSequenceKey(key []byte) bool
- func IsTableKey(tableKey []byte) bool
- func ParseAutoIncrementIDKey(key []byte) (int64, error)
- func ParseAutoRandomTableIDKey(key []byte) (int64, error)
- func ParseAutoTableIDKey(key []byte) (int64, error)
- func ParseDBKey(dbkey []byte) (int64, error)
- func ParseSequenceKey(key []byte) (int64, error)
- func ParseTableKey(tableKey []byte) (int64, error)
- func SequenceKey(sequenceID int64) []byte
- func TableKey(tableID int64) []byte
- type AccessorPicker
- type AutoIDAccessor
- type AutoIDAccessors
- type AutoIDGroup
- type DDLTableVersion
- type DailyRUStats
- type Element
- type ElementKeyType
- type GroupRUStats
- type HLastJobIterator
- type JobListKeyType
- type LastJobIterator
- type Meta
- func (m *Meta) AddHistoryDDLJob(job *model.Job, updateRawArgs bool) error
- func (m *Meta) AddResourceGroup(group *model.ResourceGroupInfo) error
- func (m *Meta) AdvanceGlobalIDs(n int) (int64, error)
- func (m *Meta) CheckDDLTableVersion() (DDLTableVersion, error)
- func (m *Meta) CheckTableExists(dbID int64, tableID int64) (bool, error)
- func (m *Meta) CheckTableNameExists(name []byte) error
- func (m *Meta) CheckTableNameNotExists(name []byte) error
- func (m *Meta) ClearAllTableNames() error
- func (m *Meta) ClearBDRRole() error
- func (m *Meta) CreateDatabase(dbInfo *model.DBInfo) error
- func (m *Meta) CreateMySQLDatabaseIfNotExists() (int64, error)
- func (m *Meta) CreatePolicy(policy *model.PolicyInfo) error
- func (m *Meta) CreateSequenceAndSetSeqValue(dbID int64, dbName string, tableInfo *model.TableInfo, seqValue int64) error
- func (m *Meta) CreateTableAndSetAutoID(dbID int64, dbName string, tableInfo *model.TableInfo, autoIDs AutoIDGroup) error
- func (m *Meta) CreateTableName(dbName string, tableName string, tableID int64) error
- func (m *Meta) CreateTableOrView(dbID int64, dbName string, tableInfo *model.TableInfo) error
- func (m *Meta) DropDatabase(dbID int64, dbName string) error
- func (m *Meta) DropDatabaseName(dbName string) error
- func (m *Meta) DropPolicy(policyID int64) error
- func (m *Meta) DropResourceGroup(groupID int64) error
- func (m *Meta) DropSequence(dbID int64, dbName string, tblID int64, tbName string) error
- func (m *Meta) DropTableName(dbName string, tableName string) error
- func (m *Meta) DropTableOrView(dbID int64, dbName string, tblID int64, tbName string) error
- func (m *Meta) EnQueueDDLJob(job *model.Job, jobListKeys ...JobListKeyType) error
- func (m *Meta) EncodeSchemaDiffKey(schemaVersion int64) kv.Key
- func (m *Meta) FinishBootstrap(version int64) error
- func (m *Meta) GenAutoTableIDKeyValue(dbID, tableID, autoID int64) (key, value []byte)
- func (m *Meta) GenGlobalID() (int64, error)
- func (m *Meta) GenGlobalIDs(n int) ([]int64, error)
- func (m *Meta) GenPlacementPolicyID() (int64, error)
- func (m *Meta) GenSchemaVersion() (int64, error)
- func (m *Meta) GenSchemaVersions(count int64) (int64, error)
- func (m *Meta) GetAllDDLJobsInQueue(jobListKeys ...JobListKeyType) ([]*model.Job, error)
- func (m *Meta) GetAutoIDAccessors(dbID, tableID int64) AutoIDAccessors
- func (m *Meta) GetBDRRole() (string, error)
- func (m *Meta) GetBootstrapVersion() (int64, error)
- func (m *Meta) GetDDLV2Initialized() (initialized bool, err error)
- func (m *Meta) GetDatabase(dbID int64) (*model.DBInfo, error)
- func (m *Meta) GetGlobalID() (int64, error)
- func (m *Meta) GetHistoryDDLCount() (uint64, error)
- func (m *Meta) GetHistoryDDLJob(id int64) (*model.Job, error)
- func (m *Meta) GetHistoryDDLJobsIterator(startJobID int64) (LastJobIterator, error)
- func (m *Meta) GetLastHistoryDDLJobsIterator() (LastJobIterator, error)
- func (m *Meta) GetMetadataLock() (enable bool, isNull bool, err error)
- func (m *Meta) GetPolicy(policyID int64) (*model.PolicyInfo, error)
- func (m *Meta) GetPolicyID() (int64, error)
- func (m *Meta) GetRUStats() (*RUStats, error)
- func (m *Meta) GetResourceGroup(groupID int64) (*model.ResourceGroupInfo, error)
- func (m *Meta) GetSchemaDiff(schemaVersion int64) (*model.SchemaDiff, error)
- func (m *Meta) GetSchemaVersion() (int64, error)
- func (m *Meta) GetSchemaVersionWithNonEmptyDiff() (int64, error)
- func (m *Meta) GetSystemDBID() (int64, error)
- func (m *Meta) GetTable(dbID int64, tableID int64) (*model.TableInfo, error)
- func (m *Meta) IterTables(dbID int64, fn func(info *model.TableInfo) error) error
- func (m *Meta) ListDatabases() ([]*model.DBInfo, error)
- func (m *Meta) ListPolicies() ([]*model.PolicyInfo, error)
- func (m *Meta) ListResourceGroups() ([]*model.ResourceGroupInfo, error)
- func (m *Meta) ListSimpleTables(dbID int64) ([]*model.TableNameInfo, error)
- func (m *Meta) ListTables(dbID int64) ([]*model.TableInfo, error)
- func (m *Meta) RestartSequenceValue(dbID int64, tableInfo *model.TableInfo, seqValue int64) error
- func (m *Meta) SetBDRRole(role string) error
- func (m *Meta) SetDDLTables(ddlTableVersion DDLTableVersion) error
- func (m *Meta) SetDDLV2Initialized(b bool) error
- func (m *Meta) SetMetadataLock(b bool) error
- func (m *Meta) SetRUStats(stats *RUStats) error
- func (m *Meta) SetSchemaDiff(diff *model.SchemaDiff) error
- func (*Meta) TableNameKey(dbName string, tableName string) kv.Key
- func (m *Meta) UpdateDatabase(dbInfo *model.DBInfo) error
- func (m *Meta) UpdatePolicy(policy *model.PolicyInfo) error
- func (m *Meta) UpdateResourceGroup(group *model.ResourceGroupInfo) error
- func (m *Meta) UpdateTable(dbID int64, tableInfo *model.TableInfo) error
- type Option
- type RUStats
Constants ¶
const ( // CurrentMagicByteVer is the current magic byte version, used for future meta compatibility. CurrentMagicByteVer byte = 0x00 // MaxInt48 is the max value of int48. MaxInt48 = 0x0000FFFFFFFFFFFF // MaxGlobalID reserves 1000 IDs. Use MaxInt48 to reserves the high 2 bytes to compatible with Multi-tenancy. MaxGlobalID = MaxInt48 - 1000 )
Variables ¶
var ( // ErrDBExists is the error for db exists. ErrDBExists = dbterror.ClassMeta.NewStd(mysql.ErrDBCreateExists) // ErrDBNotExists is the error for db not exists. ErrDBNotExists = dbterror.ClassMeta.NewStd(mysql.ErrBadDB) // ErrPolicyExists is the error for policy exists. ErrPolicyExists = dbterror.ClassMeta.NewStd(errno.ErrPlacementPolicyExists) // ErrPolicyNotExists is the error for policy not exists. ErrPolicyNotExists = dbterror.ClassMeta.NewStd(errno.ErrPlacementPolicyNotExists) // ErrResourceGroupExists is the error for resource group exists. ErrResourceGroupExists = dbterror.ClassMeta.NewStd(errno.ErrResourceGroupExists) // ErrResourceGroupNotExists is the error for resource group not exists. ErrResourceGroupNotExists = dbterror.ClassMeta.NewStd(errno.ErrResourceGroupNotExists) // ErrTableExists is the error for table exists. ErrTableExists = dbterror.ClassMeta.NewStd(mysql.ErrTableExists) // ErrTableNotExists is the error for table not exists. ErrTableNotExists = dbterror.ClassMeta.NewStd(mysql.ErrNoSuchTable) // ErrDDLReorgElementNotExist is the error for reorg element not exists. ErrDDLReorgElementNotExist = dbterror.ClassMeta.NewStd(errno.ErrDDLReorgElementNotExist) // ErrInvalidString is the error for invalid string to parse ErrInvalidString = dbterror.ClassMeta.NewStd(errno.ErrInvalidCharacterString) )
Functions ¶
func AutoIncrementIDKey ¶
AutoIncrementIDKey decodes the auto inc table key.
func AutoRandomTableIDKey ¶
AutoRandomTableIDKey encodes the auto random tableID key.
func AutoTableIDKey ¶
AutoTableIDKey decodes the auto tableID key.
func DDLJobHistoryKey ¶
DDLJobHistoryKey is only used for testing.
func DefaultGroupMeta4Test ¶
func DefaultGroupMeta4Test() *model.ResourceGroupInfo
DefaultGroupMeta4Test return the default group info for test usage.
func IsAutoIncrementIDKey ¶
IsAutoIncrementIDKey checks whether the key is auto increment key.
func IsAutoRandomTableIDKey ¶
IsAutoRandomTableIDKey checks whether the key is auto random tableID key.
func IsAutoTableIDKey ¶
IsAutoTableIDKey checks whether the key is auto tableID key.
func IsSequenceKey ¶
IsSequenceKey checks whether the key is sequence key.
func IsTableKey ¶
IsTableKey checks whether the tableKey comes from TableKey().
func ParseAutoIncrementIDKey ¶
ParseAutoIncrementIDKey decodes the tableID from the auto tableID key.
func ParseAutoRandomTableIDKey ¶
ParseAutoRandomTableIDKey decodes the tableID from the auto random tableID key.
func ParseAutoTableIDKey ¶
ParseAutoTableIDKey decodes the tableID from the auto tableID key.
func ParseDBKey ¶
ParseDBKey decodes the dbkey to get dbID.
func ParseSequenceKey ¶
ParseSequenceKey decodes the tableID from the sequence key.
func ParseTableKey ¶
ParseTableKey decodes the tableKey to get tableID.
Types ¶
type AccessorPicker ¶
type AccessorPicker interface { RowID() AutoIDAccessor RandomID() AutoIDAccessor IncrementID(tableVersion uint16) AutoIDAccessor SequenceValue() AutoIDAccessor SequenceCycle() AutoIDAccessor }
AccessorPicker is used to pick a type of auto ID accessor.
type AutoIDAccessor ¶
type AutoIDAccessor interface { Get() (int64, error) Put(val int64) error Inc(step int64) (int64, error) Del() error }
AutoIDAccessor represents the entry to retrieve/mutate auto IDs.
type AutoIDAccessors ¶
type AutoIDAccessors interface { Get() (AutoIDGroup, error) Put(autoIDs AutoIDGroup) error Del() error AccessorPicker }
AutoIDAccessors represents all the auto IDs of a table.
func NewAutoIDAccessors ¶
func NewAutoIDAccessors(m *Meta, databaseID, tableID int64) AutoIDAccessors
NewAutoIDAccessors creates a new AutoIDAccessors.
type AutoIDGroup ¶
AutoIDGroup represents a group of auto IDs of a specific table.
type DDLTableVersion ¶
type DDLTableVersion int
DDLTableVersion is to display ddl related table versions
const ( // InitDDLTableVersion is the original version. InitDDLTableVersion DDLTableVersion = 0 // BaseDDLTableVersion is for support concurrent DDL, it added tidb_ddl_job, tidb_ddl_reorg and tidb_ddl_history. BaseDDLTableVersion DDLTableVersion = 1 // MDLTableVersion is for support MDL tables. MDLTableVersion DDLTableVersion = 2 // BackfillTableVersion is for support distributed reorg stage, it added tidb_background_subtask, tidb_background_subtask_history. BackfillTableVersion DDLTableVersion = 3 )
func (DDLTableVersion) Bytes ¶
func (ver DDLTableVersion) Bytes() []byte
Bytes returns the byte slice.
type DailyRUStats ¶
type DailyRUStats struct { EndTime time.Time `json:"date"` Stats []GroupRUStats `json:"stats"` }
DailyRUStats keeps all the ru consumption statistics data.
type Element ¶
Element has the information of the backfill job's type and ID.
func DecodeElement ¶
DecodeElement decodes values from a byte slice generated with an element. It's exported for testing.
func (*Element) EncodeElement ¶
EncodeElement encodes an Element into a byte slice. It's exported for testing.
type ElementKeyType ¶
type ElementKeyType []byte
ElementKeyType is a key type of the element.
var ( // ColumnElementKey is the key for column element. ColumnElementKey ElementKeyType = []byte("_col_") // IndexElementKey is the key for index element. IndexElementKey ElementKeyType = []byte("_idx_") )
type GroupRUStats ¶
type GroupRUStats struct { ID int64 `json:"id"` Name string `json:"name"` RUConsumption *rmpb.Consumption `json:"ru_consumption"` }
GroupRUStats keeps the ru consumption statistics data.
type HLastJobIterator ¶
type HLastJobIterator struct {
// contains filtered or unexported fields
}
HLastJobIterator is the iterator for gets the latest history.
func (*HLastJobIterator) GetLastJobs ¶
GetLastJobs gets last several jobs.
type JobListKeyType ¶
type JobListKeyType []byte
JobListKeyType is a key type of the DDL job queue.
var ( // DefaultJobListKey keeps all actions of DDL jobs except "add index". // this and below list are always appended, so the order is the same as the // job's creation order. DefaultJobListKey JobListKeyType = mDDLJobListKey // AddIndexJobListKey only keeps the action of adding index. AddIndexJobListKey JobListKeyType = mDDLJobAddIdxList )
type LastJobIterator ¶
LastJobIterator is the iterator for gets latest history.
type Meta ¶
type Meta struct { StartTS uint64 // StartTS is the txn's start TS. // contains filtered or unexported fields }
Meta is for handling meta information in a transaction.
func NewMeta ¶
func NewMeta(txn kv.Transaction, options ...Option) *Meta
NewMeta creates a Meta in transaction txn. If the current Meta needs to handle a job, jobListKey is the type of the job's list.
func NewSnapshotMeta ¶
NewSnapshotMeta creates a Meta with snapshot.
func (*Meta) AddHistoryDDLJob ¶
AddHistoryDDLJob adds DDL job to history.
func (*Meta) AddResourceGroup ¶
func (m *Meta) AddResourceGroup(group *model.ResourceGroupInfo) error
AddResourceGroup creates a resource group.
func (*Meta) AdvanceGlobalIDs ¶
AdvanceGlobalIDs advances the global ID by n. return the old global ID.
func (*Meta) CheckDDLTableVersion ¶
func (m *Meta) CheckDDLTableVersion() (DDLTableVersion, error)
CheckDDLTableVersion check if the tables related to concurrent DDL exists.
func (*Meta) CheckTableExists ¶
CheckTableExists checks if the table is existed with dbID and tableID.
func (*Meta) CheckTableNameExists ¶
CheckTableNameExists checks if the table name exists.
func (*Meta) CheckTableNameNotExists ¶
CheckTableNameNotExists checks if the table name not exists.
func (*Meta) ClearAllTableNames ¶
ClearAllTableNames clears all table names.
func (*Meta) ClearBDRRole ¶
ClearBDRRole clear BDR role from storage.
func (*Meta) CreateDatabase ¶
CreateDatabase creates a database with db info.
func (*Meta) CreateMySQLDatabaseIfNotExists ¶
CreateMySQLDatabaseIfNotExists creates mysql schema and return its DB ID.
func (*Meta) CreatePolicy ¶
func (m *Meta) CreatePolicy(policy *model.PolicyInfo) error
CreatePolicy creates a policy.
func (*Meta) CreateSequenceAndSetSeqValue ¶
func (m *Meta) CreateSequenceAndSetSeqValue(dbID int64, dbName string, tableInfo *model.TableInfo, seqValue int64) error
CreateSequenceAndSetSeqValue creates sequence with tableInfo in database, and rebase the sequence seqValue.
func (*Meta) CreateTableAndSetAutoID ¶
func (m *Meta) CreateTableAndSetAutoID(dbID int64, dbName string, tableInfo *model.TableInfo, autoIDs AutoIDGroup) error
CreateTableAndSetAutoID creates a table with tableInfo in database, and rebases the table autoID.
func (*Meta) CreateTableName ¶
CreateTableName creates a table name. Used by CreateTable/RenameTable/TruncateTable/RecoverTable/RecoverSchema/CreateView...
func (*Meta) CreateTableOrView ¶
CreateTableOrView creates a table with tableInfo in database.
func (*Meta) DropDatabase ¶
DropDatabase drops whole database.
func (*Meta) DropDatabaseName ¶
DropDatabaseName drops a database name. Used by DropDatabase.
func (*Meta) DropPolicy ¶
DropPolicy drops the specified policy.
func (*Meta) DropResourceGroup ¶
DropResourceGroup drops a resource group.
func (*Meta) DropSequence ¶
DropSequence drops sequence in database. Sequence is made of table struct and kv value pair.
func (*Meta) DropTableName ¶
DropTableName drops a table name. Used by DropTable/RenameTable/TruncateTable/DropView...
func (*Meta) DropTableOrView ¶
DropTableOrView drops table in database. If delAutoID is true, it will delete the auto_increment id key-value of the table. For rename table, we do not need to rename auto_increment id key-value.
func (*Meta) EnQueueDDLJob ¶
func (m *Meta) EnQueueDDLJob(job *model.Job, jobListKeys ...JobListKeyType) error
EnQueueDDLJob adds a DDL job to the list.
func (*Meta) EncodeSchemaDiffKey ¶
EncodeSchemaDiffKey returns the raw kv key for a schema diff
func (*Meta) FinishBootstrap ¶
FinishBootstrap finishes bootstrap.
func (*Meta) GenAutoTableIDKeyValue ¶
GenAutoTableIDKeyValue generates meta key by dbID, tableID and corresponding value by autoID.
func (*Meta) GenGlobalID ¶
GenGlobalID generates next id globally.
func (*Meta) GenGlobalIDs ¶
GenGlobalIDs generates the next n global IDs.
func (*Meta) GenPlacementPolicyID ¶
GenPlacementPolicyID generates next placement policy id globally.
func (*Meta) GenSchemaVersion ¶
GenSchemaVersion generates next schema version.
func (*Meta) GenSchemaVersions ¶
GenSchemaVersions increases the schema version.
func (*Meta) GetAllDDLJobsInQueue ¶
func (m *Meta) GetAllDDLJobsInQueue(jobListKeys ...JobListKeyType) ([]*model.Job, error)
GetAllDDLJobsInQueue gets all DDL Jobs in the current queue. The length of jobListKeys can only be 1 or 0. If its length is 1, we need to replace m.jobListKey with jobListKeys[0]. Otherwise, we use m.jobListKey directly.
func (*Meta) GetAutoIDAccessors ¶
func (m *Meta) GetAutoIDAccessors(dbID, tableID int64) AutoIDAccessors
GetAutoIDAccessors gets the controller for auto IDs.
func (*Meta) GetBDRRole ¶
GetBDRRole get BDR role from storage.
func (*Meta) GetBootstrapVersion ¶
GetBootstrapVersion returns the version of the server which bootstrap the store. If the store is not bootstraped, the version will be zero.
func (*Meta) GetDDLV2Initialized ¶
GetDDLV2Initialized gets DDLV2Initialized
func (*Meta) GetDatabase ¶
GetDatabase gets the database value with ID.
func (*Meta) GetGlobalID ¶
GetGlobalID gets current global id.
func (*Meta) GetHistoryDDLCount ¶
GetHistoryDDLCount the count of all history DDL jobs.
func (*Meta) GetHistoryDDLJob ¶
GetHistoryDDLJob gets a history DDL job.
func (*Meta) GetHistoryDDLJobsIterator ¶
func (m *Meta) GetHistoryDDLJobsIterator(startJobID int64) (LastJobIterator, error)
GetHistoryDDLJobsIterator gets the jobs iterator begin with startJobID.
func (*Meta) GetLastHistoryDDLJobsIterator ¶
func (m *Meta) GetLastHistoryDDLJobsIterator() (LastJobIterator, error)
GetLastHistoryDDLJobsIterator gets latest N history ddl jobs iterator.
func (*Meta) GetMetadataLock ¶
GetMetadataLock gets the metadata lock.
func (*Meta) GetPolicy ¶
func (m *Meta) GetPolicy(policyID int64) (*model.PolicyInfo, error)
GetPolicy gets the database value with ID.
func (*Meta) GetPolicyID ¶
GetPolicyID gets current policy global id.
func (*Meta) GetRUStats ¶
GetRUStats load the persisted RUStats data.
func (*Meta) GetResourceGroup ¶
func (m *Meta) GetResourceGroup(groupID int64) (*model.ResourceGroupInfo, error)
GetResourceGroup gets the database value with ID.
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 ¶
GetSchemaVersion gets current global schema version.
func (*Meta) GetSchemaVersionWithNonEmptyDiff ¶
GetSchemaVersionWithNonEmptyDiff gets current global schema version, if diff is nil, we should return version - 1. Consider the following scenario:
// t1 t2 t3 t4 // | | | // update schema version | set diff // stale read ts
At the first time, t2 reads the schema version v10, but the v10's diff is not set yet, so it loads v9 infoSchema. But at t4 moment, v10's diff has been set and been cached in the memory, so stale read on t2 will get v10 schema from cache, and inconsistency happen. To solve this problem, we always check the schema diff at first, if the diff is empty, we know at t2 moment we can only see the v9 schema, so make neededSchemaVersion = neededSchemaVersion - 1. For `Reload`, we can also do this: if the newest version's diff is not set yet, it is ok to load the previous version's infoSchema, and wait for the next reload. if there are multiple consecutive jobs failed or cancelled after the schema version increased, the returned 'version - 1' might still not have diff.
func (*Meta) GetSystemDBID ¶
GetSystemDBID gets the system DB ID. return (0, nil) indicates that the system DB does not exist.
func (*Meta) IterTables ¶
IterTables iterates all the table at once, in order to avoid oom.
func (*Meta) ListDatabases ¶
ListDatabases shows all databases.
func (*Meta) ListPolicies ¶
func (m *Meta) ListPolicies() ([]*model.PolicyInfo, error)
ListPolicies shows all policies.
func (*Meta) ListResourceGroups ¶
func (m *Meta) ListResourceGroups() ([]*model.ResourceGroupInfo, error)
ListResourceGroups shows all resource groups.
func (*Meta) ListSimpleTables ¶
func (m *Meta) ListSimpleTables(dbID int64) ([]*model.TableNameInfo, error)
ListSimpleTables shows all simple tables in database.
func (*Meta) ListTables ¶
ListTables shows all tables in database.
func (*Meta) RestartSequenceValue ¶
RestartSequenceValue resets the the sequence value.
func (*Meta) SetBDRRole ¶
SetBDRRole write BDR role into storage.
func (*Meta) SetDDLTables ¶
func (m *Meta) SetDDLTables(ddlTableVersion DDLTableVersion) error
SetDDLTables write a key into storage.
func (*Meta) SetDDLV2Initialized ¶
SetDDLV2Initialized set DDLV2Initialized.
func (*Meta) SetMetadataLock ¶
SetMetadataLock sets the metadata lock.
func (*Meta) SetRUStats ¶
SetRUStats persist new ru stats data to meta storage.
func (*Meta) SetSchemaDiff ¶
func (m *Meta) SetSchemaDiff(diff *model.SchemaDiff) error
SetSchemaDiff sets the modification information on a given schema version.
func (*Meta) TableNameKey ¶
TableNameKey constructs the key for table name.
func (*Meta) UpdateDatabase ¶
UpdateDatabase updates a database with db info.
func (*Meta) UpdatePolicy ¶
func (m *Meta) UpdatePolicy(policy *model.PolicyInfo) error
UpdatePolicy updates a policy.
func (*Meta) UpdateResourceGroup ¶
func (m *Meta) UpdateResourceGroup(group *model.ResourceGroupInfo) error
UpdateResourceGroup updates a resource group.
type Option ¶
type Option func(m *Meta)
Option is for Meta option.
func WithUpdateTableName ¶
func WithUpdateTableName() Option
WithUpdateTableName is for updating the name of the table. Only used for ddl v2.
type RUStats ¶
type RUStats struct { Latest *DailyRUStats `json:"latest"` Previous *DailyRUStats `json:"previous"` }
RUStats keeps the lastest and second lastest DailyRUStats data.