package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
AddResourceGroup is used to create one specific resource group to resource manager.
CalculateTiFlashProgress calculates TiFlash replica progress.
CheckBundle check that the rules don't overlap without explicit Override Exported for testing reasons.
CleanTiFlashProgressCache clean progress cache.
CloseTiFlashManager closes TiFlash manager.
ConfigureTiFlashPDForPartitions configures pd rule for all partition in partitioned tables.
ConfigureTiFlashPDForTable configures pd rule for unpartitioned tables.
DeleteInternalSession is the entry function for delete an internal session from SessionManager.
DeleteResourceGroup is used to delete one specific resource group from resource manager.
DeleteTiFlashPlacementRules is a helper function to delete TiFlash placement rules of given physical table IDs.
DeleteTiFlashTableSyncProgress is used to delete the tiflash table replica sync progress.
GetAllLabelRules gets all label rules from PD.
GetAllRuleBundles is used to get all rule bundles from PD It is used to load full rules from PD while fullload infoschema.
GetAllServerInfo gets all servers static information from etcd.
GetEtcdClient is only used for test.
GetLabelRules gets the label rules according to the given IDs from PD.
GetMockTiFlash can only be used in tests to get MockTiFlash.
GetPDScheduleConfig gets the schedule information from pd.
GetPrometheusAddr gets prometheus Address.
GetReplicationState is used to check if regions in the given keyranges are replicated from PD.
GetResourceGroup is used to get one specific resource group from resource manager.
GetRuleBundle is used to get one specific rule bundle from PD.
GetServerInfo gets self server static information.
GetServerInfoByID gets specified server static information from etcd.
GetTiCDCServerInfo gets all TiCDC servers information from etcd.
GetTiFlashGroupRules to get all placement rule in a certain group.
GetTiFlashProgressFromCache gets tiflash replica progress from tiflashProgressCache.
GetTiFlashRegionCountFromPD is a helper function calling `/stats/region`.
GetTiFlashStoresStat gets the TiKV store information by accessing PD's api.
GetTiProxyServerInfo gets all TiProxy servers information from etcd.
GlobalInfoSyncerInit return a new InfoSyncer.
ListResourceGroups is used to get all resource groups from resource manager.
MakeNewRule creates a pd rule for TiFlash.
MakeRuleID creates a rule ID for TiFlash with given TableID.
ModifyResourceGroup is used to modify one specific resource group to resource manager.
MustGetTiFlashProgress gets tiflash replica progress from tiflashProgressCache, if cache not exist, it calculates progress from PD and TiFlash and inserts progress into cache.
NewMockResourceManagerClient return a mock ResourceManagerClient for test usage.
NewMockTiFlash creates a MockTiFlash with a mocked TiFlash server.
PutLabelRule synchronizes the label rule to PD.
PutRuleBundles is used to post specific rule bundles to PD.
PutRuleBundlesWithDefaultRetry will retry for default times.
PutRuleBundlesWithRetry will retry for specified times when PutRuleBundles failed.
SetEtcdClient is only used for test.
SetMockTiFlash can only be used in tests to set MockTiFlash.
SetPDHttpCliForTest sets the pdhttp.Client for testing.
SetPDScheduleConfig sets the schedule information for pd.
SetTiFlashGroupConfig is a helper function to set tiflash rule group config.
SetTiFlashPlacementRule is a helper function to set placement rule.
StoreInternalSession is the entry function for store an internal session to SessionManager.
SyncTiFlashTableSchema syncs TiFlash table schema.
UpdateLabelRules synchronizes the label rule to PD.
UpdateServerLabel updates the server label for global info syncer.
UpdateTiFlashProgressCache updates tiflashProgressCache.
# Constants
PlacementScheduleStateInProgress corresponds to "INPROGRESS" from PD.
PlacementScheduleStatePending corresponds to "PENDING" from PD.
PlacementScheduleStateScheduled corresponds to "REPLICATED" from PD.
ReportInterval is interval of infoSyncerKeeper reporting min startTS.
RequestRetryInterval is the sleep time before next retry for http request.
ServerInformationPath store server information such as IP, port and so on.
ServerMinStartTSPath store the server min start timestamp.
SyncBundlesMaxRetry is the max retry times for sync placement bundles.
TablePrometheusCacheExpiry is the expiry time for prometheus address cache.
TiFlashTableSyncProgressPath store the tiflash table replica sync progress.
TopologyInformationPath means etcd path for storing topology info.
TopologyPrometheus means address of prometheus.
TopologySessionTTL is ttl for topology, ant it's the ETCD session's TTL in seconds.
TopologyTiCDC means address of TiCDC.
TopologyTimeToRefresh means time to refresh etcd.
TopologyTiProxy means address of TiProxy.
# Variables
ErrHTTPServiceError means we got a http response with a status code which is not '2xx'.
ErrPrometheusAddrIsNotSet is the error that Prometheus address is not set in PD and etcd.
MockGlobalServerInfoManagerEntry is a mock global ServerInfoManager entry.
# Structs
InfoSyncer stores server info to etcd when the tidb-server starts and delete when tidb-server shuts down.
MockGlobalServerInfoManager manages serverInfos in Distributed unit tests.
MockTiFlash mocks a TiFlash, with necessary Pd support.
MockTiFlashError represents MockTiFlash error.
PDLabelManager manages rules with pd.
PDPlacementManager manages placement with pd.
PDScheduleManager manages schedule with pd.
ServerInfo is server static information.
ServerVersionInfo is the server version and git_hash.
TiCDCInfo is the server info for TiCDC.
TiFlashReplicaManagerCtx manages placement with pd and replica progress for TiFlash.
TiProxyServerInfo is the server info for TiProxy.
TopologyInfo is the topology info.
# Interfaces
LabelRuleManager manages label rules.
PlacementManager manages placement settings.
ScheduleManager manages schedule configs.
TiFlashReplicaManager manages placement settings and replica progress for TiFlash.
# Type aliases
PlacementScheduleState is the returned third-valued state from GetReplicationState().