-
Notifications
You must be signed in to change notification settings - Fork 725
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
pdctl: support config balance-leader
#4656
Changes from 1 commit
ab6f582
53e0973
6342864
f5be6dd
263cc1c
83c67aa
26b44f7
fb15d6a
0976e10
7798e88
0528f86
3f139b8
065f012
15925f9
f55e76b
6f9232b
2694e4c
a6a178b
ebd48ed
795c69b
9672a21
751aa6d
701a28a
2a93316
db1a5c8
50d4922
ef8b984
ccd2858
0245a45
b098573
ecef60b
0e5a34f
6738352
2f24cb6
55cb08d
2a0f3af
521e0b9
4c08c71
393b884
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -442,10 +442,31 @@ func NewConfigSchedulerCommand() *cobra.Command { | |||||
newConfigHotRegionCommand(), | ||||||
newConfigShuffleRegionCommand(), | ||||||
newConfigGrantHotRegionCommand(), | ||||||
newConfigBalanceLeaderCommand(), | ||||||
) | ||||||
return c | ||||||
} | ||||||
|
||||||
func newConfigBalanceLeaderCommand() *cobra.Command { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function is similar with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
maybe I can abstract out a function for all schedulers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, each scheduler has a different config API. It is possible to refactor it in the future, so I think just implement it simply now. |
||||||
c := &cobra.Command{ | ||||||
Use: "balance-leader-scheduler", | ||||||
Short: "balance-leader-scheduler config", | ||||||
Run: listSchedulerConfigCommandFunc, | ||||||
} | ||||||
|
||||||
c.AddCommand(&cobra.Command{ | ||||||
Use: "show", | ||||||
Short: "list the config item", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Run: listSchedulerConfigCommandFunc, | ||||||
}, &cobra.Command{ | ||||||
Use: "set <key> <value>", | ||||||
Short: "set the config item", | ||||||
Run: func(cmd *cobra.Command, args []string) { postSchedulerConfigCommandFunc(cmd, c.Name(), args) }, | ||||||
}) | ||||||
|
||||||
return c | ||||||
} | ||||||
|
||||||
func newConfigHotRegionCommand() *cobra.Command { | ||||||
c := &cobra.Command{ | ||||||
Use: "balance-hot-region-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.
How about other 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.
other schedulers should modify their config handler firstly