[
https://issues.apache.org/jira/browse/HDDS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16596851#comment-16596851
]
Ajay Kumar commented on HDDS-379:
---------------------------------
[~elek] thanks for updating the patch. Patch looks good to me. Few comments:
* SCMCli doesn't utilize {{GenericOptionsParser}} which allows users to pass
config value from cli. (i.e -D) , either we can implement Tool interface or
directly use {{GenericOptionsParser}} to enable this.
* Rename
** {{CreateSubcommand}} to {{CreateSubCommand}}
** {{CloseSubcommand}} to {{CloseSubCommand}}
** {{DeleteSubcommand}} to {{DeleteSubCommand}}
** {{InfoSubcommand}} to {{InfoSubCommand}}
** {{ListSubcommand}} to {{ListSubCommand}}
* SCMCLI: Scm Cli can be used for other commands other than container as well.
Ex to exit SCM out of chill mode.
** L73 change {{"ozone scm cli container"}} to {{"ozone scm cli"}}
** L74 change {{Developer tools to handle container specific}} to {{Developer
tools to handle SCM specific}}
* Seems specifying invalid scm host doesn't print any error or help message
even with verbose option. {{bin/ozone scmcli --scm=abc:8020 --verbose}}
However it does show error when we add subcommand (but still not the full stack
trace, error is good enough in this case but in some cases full stack trace
might be handy):
{code}bin/ozone scmcli --scm=abc:8020 --verbose list --start=0
Invalid host name: local host is: (unknown); destination host is: "abc":8020;
java.net.UnknownHostException; For more details see:
http://wiki.apache.org/hadoop/UnknownHost{code}
> Simplify and improve the cli arg parsing of ozone scmcli
> --------------------------------------------------------
>
> Key: HDDS-379
> URL: https://issues.apache.org/jira/browse/HDDS-379
> Project: Hadoop Distributed Data Store
> Issue Type: Improvement
> Reporter: Elek, Marton
> Assignee: Elek, Marton
> Priority: Major
> Fix For: 0.2.1
>
> Attachments: HDDS-379.001.patch, HDDS-379.002.patch
>
>
> SCMCLI is a useful tool to test SCM. It can create/delete/close/list
> containers.
> There are multiple problems with the current scmcli.
> The biggest one is the cli argument handling. Similar to HDDS-190, it's often
> very hard to get the help for a specific subcommand.
> The other one is that a big part of the code is the argument handling which
> is mixed with the business logic.
> I propose to use a more modern argument handler library and simplify the
> argument handling (and improve the user experience).
> I propose to use [picocli|https://github.com/remkop/picocli].
> 1.) It supports subcommands and subcommand specific and general arguments.
> 2.) It could work based on annotation with very few additional boilerplate
> code
> 3.) It's very well documented and easy to use
> 4.) It's licenced under Apache licence
> 5.) It supports tab autocompletion for bash and zsh and colorful output
> 6.) Actively maintainer project
> 7.) Adopter by other bigger projects (groovy, junit, log4j)
> In this patch I would like to demonstrate how the cli handling could be
> simplified. And if it's accepted, we can start to use similar approach for
> other ozone cli as well.
> The patch also fixes the cli (the name of the main class was wrong).
> It also requires HDDS-377 for the be compiled.
> I also deleted the TestSCMCli. It was turned off with an annotation and I
> believe that this functionality could be tested more easily with a robot test.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]