Skip to content

Update the new bookkeeper tools to use the new framework#1478

Closed
sijie wants to merge 1 commit intoapache:masterfrom
sijie:bkctl_tools
Closed

Update the new bookkeeper tools to use the new framework#1478
sijie wants to merge 1 commit intoapache:masterfrom
sijie:bkctl_tools

Conversation

@sijie
Copy link
Copy Markdown
Member

@sijie sijie commented Jun 4, 2018

Descriptions of the changes in this PR:

Motivation

#1471 introduces a new tools framework based on jcommander. This PR is changing the new bookkeeper-tools to leverage that framework.

Solution

  • Changed the related classes to use the new framework.
  • Rename BookKeeperCLI to BKCtl and bookkeeper-cli to bkctl
  • Use service loader to load command groups to allow better extensibility
  • Rename command group cluster to bookies

Results

Example output of this change:

$ bin/bkctl
bkctl interacts and operates Apache BookKeeper clusters

Usage:  bkctl [flags] [command group] [commands]

Commands:

    bookie      Commands on operating a single bookie
    bookies     Commands on operating a cluster of bookies
    ledger      Commands on interacting with ledgers

    help        Display help information about it

Flags:

    -c, --conf
        Configuration file

    -u, --service-uri
        Service Uri


    -h, --help
        Display help information

Use "bkctl [command] --help" or "bkctl help [command]" for more information
about a command

sub command

$ bin/bkctl help bookie
Commands on operating a single bookie

Usage:  bkctl bookie [command] [command options]

Commands:

    lastmark        Print last log marker

    help            Display help information about it

Use "bkctl bookie [command] --help" or "bkctl bookie help [command]" for more
information about a command

sub-sub command

$ bin/bkctl bookie help lastmark
Print last log marker

Usage:  bkctl bookie lastmark [flags]

Flags:


    -h, --help
        Display help information

*Motivation*

previous PR introduces a new framework wrapping over jcommander. This PR is changing the new bookkeeper cli tools
to leverage that framework.

*Solution*

- Changed the related classes to use the new framework

At the same time, rename `BookKeeperCLI` to `BKCtl` and `bookkeeper-cli` to `bkctl`

Exclude bookkeeper-tools-framework from shaded libs

Rename `cluster` to `bookies`
@sijie sijie added this to the 4.8.0 milestone Jun 4, 2018
@sijie sijie self-assigned this Jun 5, 2018
@sijie sijie closed this in b9b4617 Jun 5, 2018
sijie added a commit that referenced this pull request Jun 7, 2018
Descriptions of the changes in this PR:

*Motivation*

This PR follows #1478  to move table service cli to bookkeeper-tools.
So different service components are now available in one cli tool.

*Changes*

- move stream/cli module to tools/stream module
- organize the table service commands as groups:

* cluster
* namespace
* table
* tables

*Output*

Example output:

```
$ bin/bkctl
bkctl interacts and operates Apache BookKeeper clusters

Usage:  bkctl [flags] [command group] [commands]

Commands:

    bookie          Commands on operating a single bookie
    bookies         Commands on operating a cluster of bookies
    cluster         Commands on administrating bookkeeper clusters
    ledger          Commands on interacting with ledgers
    namespace       Commands on operating namespaces
    table           Commands on interacting with tables
    tables          Commands on operating tables

    help            Display help information about it

Flags:

    -c, --conf
        Configuration file

    -n, --namespace
        Namespace scope to run commands (only valid for table service for now)

    -u, --service-uri
        Service Uri

    -h, --help
        Display help information

Use "bkctl [command] --help" or "bkctl help [command]" for more information
about a command
```

Author: Sijie Guo <sijie@apache.org>

Reviewers: Jia Zhai <None>

This closes #1485 from sijie/stream_cli
@sijie sijie deleted the bkctl_tools branch July 16, 2018 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants