-
Notifications
You must be signed in to change notification settings - Fork 206
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
feat(horaectl): impl horaectl in rs #1481
Conversation
e912dee
to
84c3c3e
Compare
horaectl/Cargo.toml
Outdated
|
||
[dependencies] | ||
chrono = { workspace = true } | ||
clap = { version = "=4.4.18", features = ["derive"] } |
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.
I thinks other crates also depend on this, make it workspace level dep.
Also check for other dependencies.
horaectl/src/cmd/cluster.rs
Outdated
}; | ||
|
||
pub fn cluster() -> Command { | ||
Command::new("cluster") |
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.
Use derive macro to define command, it's more concise. See
https://github.com/apache/incubator-horaedb/blob/cd70bfc2394255afdf401a6d885de2d8bd140021/src/tools/src/bin/sst-convert.rs#L48
horaectl/src/cmd/mod.rs
Outdated
let args = match read_args() { | ||
Ok(args) => args, | ||
Err(e) => { | ||
println!("{}", e); |
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.
println!("{}", e); | |
println!("Read input failed, err:{e}"); |
84c3c3e
to
56bf68b
Compare
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.
LGTM
## Rationale Implement horaectl using rust ## Detailed Changes - Support `cluster list`, `cluster diagnose`, `cluster schedule` ``` $ target/debug/horaectl -h HoraeCTL is a command line tool for HoraeDB Usage: horaectl [OPTIONS] [COMMAND] Commands: cluster Operations on cluster help Print this message or the help of the given subcommand(s) Options: -m, --meta <META_ADDR> Meta addr [env: HORAECTL_META_ADDR=] [default: 127.0.0.1:8080] -c, --cluster <CLUSTER_NAME> Cluster name [env: HORAECTL_CLUSTER=] [default: defaultCluster] -i, --interactive Enter interactive mode -h, --help Print help $ target/debug/horaectl cluster -h Operations on cluster Usage: horaectl cluster [OPTIONS] <COMMAND> Commands: list List cluster diagnose Diagnose cluster schedule Schedule cluster help Print this message or the help of the given subcommand(s) Options: -m, --meta <META_ADDR> Meta addr [env: HORAECTL_META_ADDR=] [default: 127.0.0.1:8080] -c, --cluster <CLUSTER_NAME> Cluster name [env: HORAECTL_CLUSTER=] [default: defaultCluster] -h, --help Print help ``` ## Test Plan - Manual tests --------- Co-authored-by: jiacai2050 <dev@liujiacai.net>
## Rationale Implement horaectl using rust ## Detailed Changes - Support `cluster list`, `cluster diagnose`, `cluster schedule` ``` $ target/debug/horaectl -h HoraeCTL is a command line tool for HoraeDB Usage: horaectl [OPTIONS] [COMMAND] Commands: cluster Operations on cluster help Print this message or the help of the given subcommand(s) Options: -m, --meta <META_ADDR> Meta addr [env: HORAECTL_META_ADDR=] [default: 127.0.0.1:8080] -c, --cluster <CLUSTER_NAME> Cluster name [env: HORAECTL_CLUSTER=] [default: defaultCluster] -i, --interactive Enter interactive mode -h, --help Print help $ target/debug/horaectl cluster -h Operations on cluster Usage: horaectl cluster [OPTIONS] <COMMAND> Commands: list List cluster diagnose Diagnose cluster schedule Schedule cluster help Print this message or the help of the given subcommand(s) Options: -m, --meta <META_ADDR> Meta addr [env: HORAECTL_META_ADDR=] [default: 127.0.0.1:8080] -c, --cluster <CLUSTER_NAME> Cluster name [env: HORAECTL_CLUSTER=] [default: defaultCluster] -h, --help Print help ``` ## Test Plan - Manual tests --------- Co-authored-by: jiacai2050 <dev@liujiacai.net>
## Rationale Implement horaectl using rust ## Detailed Changes - Support `cluster list`, `cluster diagnose`, `cluster schedule` ``` $ target/debug/horaectl -h HoraeCTL is a command line tool for HoraeDB Usage: horaectl [OPTIONS] [COMMAND] Commands: cluster Operations on cluster help Print this message or the help of the given subcommand(s) Options: -m, --meta <META_ADDR> Meta addr [env: HORAECTL_META_ADDR=] [default: 127.0.0.1:8080] -c, --cluster <CLUSTER_NAME> Cluster name [env: HORAECTL_CLUSTER=] [default: defaultCluster] -i, --interactive Enter interactive mode -h, --help Print help $ target/debug/horaectl cluster -h Operations on cluster Usage: horaectl cluster [OPTIONS] <COMMAND> Commands: list List cluster diagnose Diagnose cluster schedule Schedule cluster help Print this message or the help of the given subcommand(s) Options: -m, --meta <META_ADDR> Meta addr [env: HORAECTL_META_ADDR=] [default: 127.0.0.1:8080] -c, --cluster <CLUSTER_NAME> Cluster name [env: HORAECTL_CLUSTER=] [default: defaultCluster] -h, --help Print help ``` ## Test Plan - Manual tests --------- Co-authored-by: jiacai2050 <dev@liujiacai.net>
Rationale
Implement horaectl using rust
Detailed Changes
cluster list
,cluster diagnose
,cluster schedule
Test Plan