Skip to content

Commit

Permalink
fix comment: rename
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Aug 8, 2024
1 parent 25f5f1a commit bdb4d19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/mcs/scheduling/server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (c *Cluster) updateScheduler() {
)
// Create the newly added schedulers.
for _, scheduler := range latestSchedulersConfig {
schedulerType := types.ConvertOldStr2Type[scheduler.Type]
schedulerType := types.ConvertOldStrToType[scheduler.Type]
s, err := schedulers.CreateScheduler(
schedulerType,
c.coordinator.GetOperatorController(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/mock/mockconfig/mockconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func NewTestOptions() *config.PersistOptions {
// register default schedulers in case config check fail.
for _, d := range sc.DefaultSchedulers {
sc.RegisterScheduler(types.ConvertOldStr2Type[d.Type])
sc.RegisterScheduler(types.ConvertOldStrToType[d.Type])
}
c := config.NewConfig()
c.Adjust(nil, false)
Expand Down
4 changes: 2 additions & 2 deletions pkg/schedule/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (c *Coordinator) InitSchedulers(needRun bool) {
log.Info("skip create scheduler with independent configuration", zap.String("scheduler-name", name), zap.String("scheduler-type", cfg.Type), zap.Strings("scheduler-args", cfg.Args))
continue
}
s, err := schedulers.CreateScheduler(types.ConvertOldStr2Type[cfg.Type], c.opController,
s, err := schedulers.CreateScheduler(types.ConvertOldStrToType[cfg.Type], c.opController,
c.cluster.GetStorage(), schedulers.ConfigJSONDecoder([]byte(data)), c.schedulers.RemoveScheduler)
if err != nil {
log.Error("can not create scheduler with independent configuration", zap.String("scheduler-name", name), zap.Strings("scheduler-args", cfg.Args), errs.ZapError(err))
Expand Down Expand Up @@ -320,7 +320,7 @@ func (c *Coordinator) InitSchedulers(needRun bool) {
continue
}

tp := types.ConvertOldStr2Type[schedulerCfg.Type]
tp := types.ConvertOldStrToType[schedulerCfg.Type]
s, err := schedulers.CreateScheduler(tp, c.opController,
c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(tp, schedulerCfg.Args), c.schedulers.RemoveScheduler)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/schedule/type/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const (
LabelScheduler CheckerSchedulerType = "label-scheduler"
)

// TODO: SchedulerTypeCompatibleMap and ConvertOldStr2Type should be removed after
// TODO: SchedulerTypeCompatibleMap and ConvertOldStrToType should be removed after
// fixing this issue(https://github.com/tikv/pd/issues/8474).
var (
// SchedulerTypeCompatibleMap exists for compatibility.
Expand All @@ -100,10 +100,10 @@ var (
LabelScheduler: "label",
}

// ConvertOldStr2Type exists for compatibility.
// ConvertOldStrToType exists for compatibility.
//
// It is used to convert the old scheduler type to `CheckerSchedulerType`.
ConvertOldStr2Type = map[string]CheckerSchedulerType{
ConvertOldStrToType = map[string]CheckerSchedulerType{
"balance-leader": BalanceLeaderScheduler,
"balance-region": BalanceRegionScheduler,
"balance-witness": BalanceWitnessScheduler,
Expand Down

0 comments on commit bdb4d19

Please sign in to comment.