-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: instead scheduler type string of types.CheckerSchedulerType #8485
Conversation
Signed-off-by: okJiang <[email protected]>
Skipping CI for Draft Pull Request. |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8485 +/- ##
==========================================
- Coverage 77.40% 77.38% -0.02%
==========================================
Files 472 472
Lines 61800 61826 +26
==========================================
+ Hits 47838 47846 +8
- Misses 10395 10415 +20
+ Partials 3567 3565 -2
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: okJiang <[email protected]>
@@ -275,7 +276,7 @@ func (c *Coordinator) InitSchedulers(needRun bool) { | |||
typ := schedulers.FindSchedulerTypeByName(name) | |||
var cfg sc.SchedulerConfig | |||
for _, c := range scheduleCfg.Schedulers { | |||
if c.Type == typ { | |||
if c.Type == types.SchedulerTypeCompatibleMap[typ] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming to ConvertNewType2OldStr
Signed-off-by: okJiang <[email protected]>
pkg/schedule/type/type.go
Outdated
} | ||
|
||
// SchedulerStr2Type is a map to convert the scheduler string to the CheckerSchedulerType. | ||
SchedulerStr2Type = map[string]CheckerSchedulerType{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringToSchedulerType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest LGTM
Signed-off-by: okJiang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest LGTM
@@ -43,8 +43,6 @@ import ( | |||
const ( | |||
// BalanceLeaderName is balance leader scheduler name. | |||
BalanceLeaderName = "balance-leader-scheduler" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we will unify it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be in the next pr
pkg/mcs/scheduling/server/cluster.go
Outdated
@@ -309,11 +309,12 @@ func (c *Cluster) updateScheduler() { | |||
) | |||
// Create the newly added schedulers. | |||
for _, scheduler := range latestSchedulersConfig { | |||
schedulerType := types.ConvertOldStr2Type[scheduler.Type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does ConvertOldStrToType sound to you? Variable names with embedded numbers are not common in PD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are same for me. I can update it
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lhy1024, niubell, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: Ref #8379
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note