Documentation ¶
Index ¶
- Variables
- func GetPlacementRules(ctx context.Context, pdAddr string, tlsConf *tls.Config) ([]placement.Rule, error)
- func ResetTS(ctx context.Context, pdAddr string, ts uint64, tlsConf *tls.Config) error
- func SearchPlacementRule(tableID int64, placementRules []placement.Rule, role placement.PeerRoleType) *placement.Rule
- type PdController
- func (p *PdController) Close()
- func (p *PdController) GetClusterVersion(ctx context.Context) (string, error)
- func (p *PdController) GetPDClient() pd.Client
- func (p *PdController) GetPDScheduleConfig(ctx context.Context) (map[string]interface{}, error)
- func (p *PdController) GetRegionCount(ctx context.Context, startKey, endKey []byte) (int, error)
- func (p *PdController) ListSchedulers(ctx context.Context) ([]string, error)
- func (p *PdController) RemoveSchedulers(ctx context.Context) (undo UndoFunc, err error)
- func (p *PdController) ResumeSchedulers(ctx context.Context, schedulers []string) error
- func (p *PdController) SetHTTP(addrs []string, cli *http.Client)
- func (p *PdController) SetPDClient(pdClient pd.Client)
- func (p *PdController) UpdatePDScheduleConfig(ctx context.Context) error
- type UndoFunc
Constants ¶
This section is empty.
Variables ¶
var ( // Schedulers represent region/leader schedulers which can impact on performance. Schedulers = map[string]struct{}{ "balance-leader-scheduler": {}, "balance-hot-region-scheduler": {}, "balance-region-scheduler": {}, "shuffle-leader-scheduler": {}, "shuffle-region-scheduler": {}, "shuffle-hot-region-scheduler": {}, } )
Functions ¶
func GetPlacementRules ¶
func GetPlacementRules(ctx context.Context, pdAddr string, tlsConf *tls.Config) ([]placement.Rule, error)
GetPlacementRules return the current placement rules.
func SearchPlacementRule ¶
func SearchPlacementRule(tableID int64, placementRules []placement.Rule, role placement.PeerRoleType) *placement.Rule
SearchPlacementRule returns the placement rule matched to the table or nil.
Types ¶
type PdController ¶
type PdController struct {
// contains filtered or unexported fields
}
PdController manage get/update config from pd.
func NewPdController ¶
func NewPdController( ctx context.Context, pdAddrs string, tlsConf *tls.Config, securityOption pd.SecurityOption, ) (*PdController, error)
NewPdController creates a new PdController.
func (*PdController) GetClusterVersion ¶
func (p *PdController) GetClusterVersion(ctx context.Context) (string, error)
GetClusterVersion returns the current cluster version.
func (*PdController) GetPDClient ¶
func (p *PdController) GetPDClient() pd.Client
GetPDClient set pd addrs and cli for test.
func (*PdController) GetPDScheduleConfig ¶
func (p *PdController) GetPDScheduleConfig( ctx context.Context, ) (map[string]interface{}, error)
GetPDScheduleConfig returns PD schedule config value associated with the key. It returns nil if there is no such config item.
func (*PdController) GetRegionCount ¶
GetRegionCount returns the region count in the specified range.
func (*PdController) ListSchedulers ¶
func (p *PdController) ListSchedulers(ctx context.Context) ([]string, error)
ListSchedulers list all pd scheduler.
func (*PdController) RemoveSchedulers ¶
func (p *PdController) RemoveSchedulers(ctx context.Context) (undo UndoFunc, err error)
RemoveSchedulers removes the schedulers that may slow down BR speed.
func (*PdController) ResumeSchedulers ¶
func (p *PdController) ResumeSchedulers(ctx context.Context, schedulers []string) error
ResumeSchedulers resume pd scheduler.
func (*PdController) SetHTTP ¶
func (p *PdController) SetHTTP(addrs []string, cli *http.Client)
SetHTTP set pd addrs and cli for test.
func (*PdController) SetPDClient ¶
func (p *PdController) SetPDClient(pdClient pd.Client)
SetPDClient set pd addrs and cli for test.
func (*PdController) UpdatePDScheduleConfig ¶
func (p *PdController) UpdatePDScheduleConfig(ctx context.Context) error
UpdatePDScheduleConfig updates PD schedule config value associated with the key.