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

feat(horaectl): impl horaectl in rs #1481

Merged
merged 6 commits into from
Mar 15, 2024

Conversation

baojinri
Copy link
Contributor

@baojinri baojinri commented Feb 6, 2024

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


[dependencies]
chrono = { workspace = true }
clap = { version = "=4.4.18", features = ["derive"] }
Copy link
Contributor

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.

};

pub fn cluster() -> Command {
Command::new("cluster")
Copy link
Contributor

Choose a reason for hiding this comment

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

let args = match read_args() {
Ok(args) => args,
Err(e) => {
println!("{}", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
println!("{}", e);
println!("Read input failed, err:{e}");

Copy link
Contributor

@jiacai2050 jiacai2050 left a comment

Choose a reason for hiding this comment

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

LGTM

@jiacai2050 jiacai2050 merged commit 629bf39 into apache:main Mar 15, 2024
10 checks passed
zealchen pushed a commit to zealchen/incubator-horaedb that referenced this pull request Apr 9, 2024
## 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>
zealchen pushed a commit to zealchen/incubator-horaedb that referenced this pull request Apr 9, 2024
## 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>
zealchen pushed a commit to zealchen/incubator-horaedb that referenced this pull request Apr 9, 2024
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants