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
server: support command line output config info #12956
Conversation
Signed-off-by: glorv <glorvs@163.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: glorv <glorvs@163.com>
… json-config-info
Signed-off-by: glorv <glorvs@163.com>
components/server/src/server.rs
Outdated
) { | ||
for (k, v) in default_obj.iter() { | ||
let cfg_val = value_obj.get(k); | ||
append_sub_key(key_buf, k); |
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.
These tiny functions don't make it easy to review. How about
append_sub_key(key_buf, k); | |
let old_len = key_buf.len(); | |
if !k.is_empty() { | |
key.push_str(k); | |
key.push('.'); | |
} |
components/server/src/server.rs
Outdated
} else { | ||
res.push(to_cfg_value(v, cfg_val, key_buf)); | ||
} | ||
pop_sub_key(key_buf, k); |
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.
pop_sub_key(key_buf, k); | |
key_buf.truncate(old_len); |
components/server/src/server.rs
Outdated
@@ -1851,3 +1854,118 @@ impl IOBudgetAdjustor for EnginesResourceInfo { | |||
(total_budgets as f32 * score) as usize | |||
} | |||
} | |||
|
|||
// currently, only support return json result | |||
pub fn get_flatten_cfg_info(cfg: &TiKvConfig) -> Vec<Value> { |
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.
Put it near TiKvConfig
?
Signed-off-by: glorv <glorvs@163.com>
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.
Could you paste a sample output? I'm not sure if deprecated items are printed.
emm.. The currently implement outputs all serializable config fields. The configs included are the same as all the configs in the The current output is like:
|
@glorv deprecated items are all marked with You can verify it by checking a deprecated config e.g. If |
Signed-off-by: glorv <glorvs@163.com>
… json-config-info
I have checked all the configs, there are only 8 commented with |
@tabokie can we merge this pr now? |
Sure, I already approved it. |
/merge |
@tabokie: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 8033514
|
Signed-off-by: glorv glorvs@163.com
What is changed and how it works?
Issue Number: ref #12492
What's Changed:
This is a simplified implementation of #12517 that only support output "Name, DefaultValue and ValueInFile", so we can avoid using the complex proc-macro.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note