Documentation ¶
Index ¶
- func GetAllTiKVStores(ctx context.Context, pdClient pd.Client, storeBehavior StoreBehavior) ([]*metapb.Store, error)
- type Mgr
- func (mgr *Mgr) Close()
- func (mgr *Mgr) GetBackupClient(ctx context.Context, storeID uint64) (backup.BackupClient, error)
- func (mgr *Mgr) GetDomain() *domain.Domain
- func (mgr *Mgr) GetLockResolver() *tikv.LockResolver
- func (mgr *Mgr) GetTLSConfig() *tls.Config
- func (mgr *Mgr) GetTiKV() tikv.Storage
- func (mgr *Mgr) ResetBackupClient(ctx context.Context, storeID uint64) (backup.BackupClient, error)
- type StoreBehavior
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllTiKVStores ¶
func GetAllTiKVStores( ctx context.Context, pdClient pd.Client, storeBehavior StoreBehavior, ) ([]*metapb.Store, error)
GetAllTiKVStores returns all TiKV stores registered to the PD client. The stores must not be a tombstone and must never contain a label `engine=tiflash`.
Types ¶
type Mgr ¶
type Mgr struct { *pdutil.PdController // contains filtered or unexported fields }
Mgr manages connections to a TiDB cluster.
func NewMgr ¶
func NewMgr( ctx context.Context, g glue.Glue, pdAddrs string, storage tikv.Storage, tlsConf *tls.Config, securityOption pd.SecurityOption, keepalive keepalive.ClientParameters, storeBehavior StoreBehavior, checkRequirements bool, ) (*Mgr, error)
NewMgr creates a new Mgr.
func (*Mgr) GetBackupClient ¶
GetBackupClient get or create a backup client.
func (*Mgr) GetLockResolver ¶
func (mgr *Mgr) GetLockResolver() *tikv.LockResolver
GetLockResolver gets the LockResolver.
func (*Mgr) GetTLSConfig ¶
GetTLSConfig returns the tls config.
func (*Mgr) ResetBackupClient ¶
ResetBackupClient reset the connection for backup client.
type StoreBehavior ¶
type StoreBehavior uint8
StoreBehavior is the action to do in GetAllTiKVStores when a non-TiKV store (e.g. TiFlash store) is found.
const ( // ErrorOnTiFlash causes GetAllTiKVStores to return error when the store is // found to be a TiFlash node. ErrorOnTiFlash StoreBehavior = 0 // SkipTiFlash causes GetAllTiKVStores to skip the store when it is found to // be a TiFlash node. SkipTiFlash StoreBehavior = 1 // TiFlashOnly caused GetAllTiKVStores to skip the store which is not a // TiFlash node. TiFlashOnly StoreBehavior = 2 )
Click to show internal directories.
Click to hide internal directories.