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): initial commit #1450

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

chunshao90
Copy link
Contributor

Rationale

Introduce command line tool for horaedb, horaectl.

Detailed Changes

  • Initial commit.
  • Support list clusters and cluster diagnose.
go run main.go --meta_addr 127.0.0.1:8080 --cluster_name defaultCluster
127.0.0.1:8080(defaultCluster) > c  
+----+----------------+------------+--------------+-----------------------------+-------------------------+-------------------------+
| ID | NAME           | SHARDTOTAL | TOPOLOGYTYPE | PROCEDUREEXECUTINGBATCHSIZE | CREATEDAT               | MODIFIEDAT              |
+----+----------------+------------+--------------+-----------------------------+-------------------------+-------------------------+
|  0 | defaultCluster |          8 | static       |                  4294967295 | 2024-01-19 15:18:57.034 | 2024-01-19 15:18:57.034 |
+----+----------------+------------+--------------+-----------------------------+-------------------------+-------------------------+
127.0.0.1:8080(defaultCluster) > c d
+---------------------+-------------------------+--------------------------+-----------------------+
| UNREGISTERED_SHARDS | UNREADY_SHARDS:SHARD_ID | UNREADY_SHARDS:NODE_NAME | UNREADY_SHARDS:STATUS |
+---------------------+-------------------------+--------------------------+-----------------------+
| []                  |                         |                          |                       |
+---------------------+-------------------------+--------------------------+-----------------------+

Test Plan

Manual test.

ctl/README.md Outdated Show resolved Hide resolved
"github.com/spf13/cobra"
)

// diagnoseCmd represents the diagnose command
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it a bit redundant to create a file for every command? How about put interfaces of the same type together, for example /api/v1/clusters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is generated by cobra-cli.

ctl/cmd/quit.go Outdated Show resolved Hide resolved
ctl/operation/util.go Show resolved Hide resolved
ctl/LICENSE Outdated Show resolved Hide resolved
ctl/LICENSE Outdated Show resolved Hide resolved
@chunshao90 chunshao90 merged commit a1041cd into apache:main Jan 22, 2024
6 checks passed
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.

4 participants