Documentation ¶
Index ¶
- Constants
- func GetAllTiKVStoresWithRetry(ctx context.Context, pdClient util.StoreMeta, storeBehavior util.StoreBehavior) ([]*metapb.Store, error)
- type Mgr
- func (mgr *Mgr) Close()
- func (mgr *Mgr) GetBackupClient(ctx context.Context, storeID uint64) (backuppb.BackupClient, error)
- func (mgr *Mgr) GetConfigFromTiKV(ctx context.Context, cli *http.Client, fn func(*http.Response) error) error
- func (mgr *Mgr) GetCurrentTsFromPD(ctx context.Context) (uint64, error)
- func (mgr *Mgr) GetDomain() *domain.Domain
- func (mgr *Mgr) GetLockResolver() *txnlock.LockResolver
- func (mgr *Mgr) GetLogBackupClient(ctx context.Context, storeID uint64) (logbackup.LogBackupClient, error)
- func (mgr *Mgr) GetStorage() kv.Storage
- func (mgr *Mgr) GetStore() tikv.Storage
- func (mgr *Mgr) GetTLSConfig() *tls.Config
- func (mgr *Mgr) IsLogBackupEnabled(ctx context.Context, client *http.Client) (bool, error)
- func (mgr *Mgr) ProcessTiKVConfigs(ctx context.Context, cfg *kvconfig.KVConfig, client *http.Client)
- type VersionCheckerType
Constants ¶
const ( // DefaultMergeRegionSizeBytes is the default region split size, 96MB. // See https://github.com/tikv/tikv/blob/v4.0.8/components/raftstore/src/coprocessor/config.rs#L35-L38 DefaultMergeRegionSizeBytes uint64 = 96 * units.MiB // DefaultMergeRegionKeyCount is the default region key count, 960000. DefaultMergeRegionKeyCount uint64 = 960000 // DefaultImportNumGoroutines is the default number of threads for import. // use 128 as default value, which is 8 times of the default value of tidb. // we think is proper for IO-bound cases. DefaultImportNumGoroutines uint = 128 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mgr ¶
type Mgr struct { *pdutil.PdController *utils.StoreManager // contains filtered or unexported fields }
Mgr manages connections to a TiDB cluster.
func NewMgr ¶
func NewMgr( ctx context.Context, g glue.Glue, pdAddrs []string, tlsConf *tls.Config, securityOption pd.SecurityOption, keepalive keepalive.ClientParameters, storeBehavior util.StoreBehavior, checkRequirements bool, needDomain bool, versionCheckerType VersionCheckerType, ) (*Mgr, error)
NewMgr creates a new Mgr.
Domain is optional for Backup, set `needDomain` to false to disable initializing Domain.
func (*Mgr) GetBackupClient ¶
GetBackupClient get or create a backup client.
func (*Mgr) GetConfigFromTiKV ¶
func (mgr *Mgr) GetConfigFromTiKV(ctx context.Context, cli *http.Client, fn func(*http.Response) error) error
GetConfigFromTiKV get configs from all alive tikv stores.
func (*Mgr) GetCurrentTsFromPD ¶
GetCurrentTsFromPD gets current ts from PD.
func (*Mgr) GetLockResolver ¶
func (mgr *Mgr) GetLockResolver() *txnlock.LockResolver
GetLockResolver gets the LockResolver.
func (*Mgr) GetLogBackupClient ¶
func (*Mgr) GetTLSConfig ¶
GetTLSConfig returns the tls config.
func (*Mgr) IsLogBackupEnabled ¶
IsLogBackupEnabled is used for br to check whether tikv has enabled log backup.
func (*Mgr) ProcessTiKVConfigs ¶
func (mgr *Mgr) ProcessTiKVConfigs(ctx context.Context, cfg *kvconfig.KVConfig, client *http.Client)
ProcessTiKVConfigs handle the tikv config for region split size, region split keys, and import goroutines in place. It retrieves the config from all alive tikv stores and returns the minimum values. If retrieving the config fails, it returns the default config values.
type VersionCheckerType ¶
type VersionCheckerType int
const ( // default version checker NormalVersionChecker VersionCheckerType = iota // version checker for PiTR StreamVersionChecker // no check NoVersionChecker )