Skip to content
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

client: add sdk api to get the config of the special scheduler #9140

Merged
merged 6 commits into from
Mar 19, 2025

Conversation

bufferflies
Copy link
Contributor

@bufferflies bufferflies commented Mar 13, 2025

What problem does this PR solve?

Issue Number: Close #9141

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Mar 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2025
@bufferflies bufferflies marked this pull request as ready for review March 13, 2025 07:15
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 13, 2025
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.28%. Comparing base (e8050f7) to head (572b8c3).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9140      +/-   ##
==========================================
- Coverage   76.37%   76.28%   -0.10%     
==========================================
  Files         474      474              
  Lines       72400    72424      +24     
==========================================
- Hits        55297    55246      -51     
- Misses      13644    13701      +57     
- Partials     3459     3477      +18     
Flag Coverage Δ
unittests 76.28% <75.00%> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// GetSchedulerConfig returns the configuration of the specified scheduler for pd cluster
func (c *client) GetSchedulerConfig(ctx context.Context, name string) (map[string]any, error) {
var config map[string]any
uri := path.Join(SchedulerConfig, name, "list")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a function in http/api.go to generate the URI, such as SchedulerConfigByName.

"name": name,
"store_id": storeID,
})
func (c *client) CreateScheduler(ctx context.Context, name string, input map[string]any) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider keeping both API methods. Users who want to create a scheduler with customized data can use CreateSchedulerWithInput, while those who only need to provide a name and storeID can use CreateScheduler.

Signed-off-by: 童剑 <[email protected]>
@bufferflies bufferflies force-pushed the sdk/scheduler branch 3 times, most recently from 7872fb0 to f9a59cd Compare March 18, 2025 09:45
@bufferflies bufferflies requested a review from JmPotato March 18, 2025 09:45
Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix ci. Rest LGTM.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 19, 2025
Signed-off-by: 童剑 <[email protected]>
Copy link
Member

@JmPotato JmPotato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM.

Signed-off-by: 童剑 <[email protected]>
@ti-chi-bot ti-chi-bot bot added the lgtm label Mar 19, 2025
Copy link
Contributor

ti-chi-bot bot commented Mar 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, lhy1024

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 19, 2025
Copy link
Contributor

ti-chi-bot bot commented Mar 19, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-19 03:00:59.097589854 +0000 UTC m=+410952.781825942: ☑️ agreed by lhy1024.
  • 2025-03-19 10:02:59.399350888 +0000 UTC m=+436273.083586984: ☑️ agreed by JmPotato.

@ti-chi-bot ti-chi-bot bot merged commit e5687bf into tikv:master Mar 19, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sdk: add new api to get the configuration of the special scheduler
3 participants