[jira] [Comment Edited] (HDDS-379) Simplify and improve the cli arg parsing of ozone scmcli

2018-08-31 Thread Anu Engineer (JIRA)


[ 
https://issues.apache.org/jira/browse/HDDS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16599446#comment-16599446
 ] 

Anu Engineer edited comment on HDDS-379 at 9/1/18 1:18 AM:
---

[~ajayydv] Thanks for the reviews and interesting comments. [~elek] Thanks for 
the contribution. The code looks much better and the output is so much better, 
I would love if ozone and 03 commands also moved to this infrastructure. The 
DM_EXIT ignore fix is not working and it really does not matter. I have 
committed this patch to the trunk.

 


was (Author: anu):
[~ajayydv] Thanks for the reviews and interesting comments. [~elek] Thanks for 
the contribution. The code looks much better and it is so much better, I would 
love if ozone and 03 commands also moved to this infrastructure. The DM_EXIT 
ignore fix is not working and it really does not matter. I have committed this 
patch to the trunk.

 

> 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, 
> HDDS-379.003.patch, HDDS-379.004.patch, HDDS-379.005.patch, HDDS-379.006.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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDDS-379) Simplify and improve the cli arg parsing of ozone scmcli

2018-08-30 Thread Ajay Kumar (JIRA)


[ 
https://issues.apache.org/jira/browse/HDDS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16597941#comment-16597941
 ] 

Ajay Kumar edited comment on HDDS-379 at 8/30/18 9:33 PM:
--

This is what quick search about word convention shows:
{quote}"a way in which something is usually done, especially within a 
particular area or activity."{quote}
First example about input/output falls in that category but i don't think so 
about the subcommand. A quick search into git will give you many examples of 
subcommand being camel-cased. 

https://github.com/kohsuke/args4j/blob/master/args4j/src/org/kohsuke/args4j/spi/SubCommand.java
 
https://github.com/AndoxynPlugins/SubCommandPluginExample


was (Author: ajayydv):
This is what quick search about word convention shows:
{quote}"a way in which something is usually done, especially within a 
particular area or activity."{quote}
In example you gave first example about input/output falls in that category but 
i don;t think so about the subcommand. I quick search into git will give you 
many examples of subcommand being camel-cased. 

https://github.com/kohsuke/args4j/blob/master/args4j/src/org/kohsuke/args4j/spi/SubCommand.java
 
https://github.com/AndoxynPlugins/SubCommandPluginExample

> 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, 
> HDDS-379.003.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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDDS-379) Simplify and improve the cli arg parsing of ozone scmcli

2018-08-30 Thread Ajay Kumar (JIRA)


[ 
https://issues.apache.org/jira/browse/HDDS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16597941#comment-16597941
 ] 

Ajay Kumar edited comment on HDDS-379 at 8/30/18 9:32 PM:
--

This is what quick search about word convention shows:
{quote}"a way in which something is usually done, especially within a 
particular area or activity."{quote}
In example you gave first example about input/output falls in that category but 
i don;t think so about the subcommand. I quick search into git will give you 
many examples of subcommand being camel-cased. 

https://github.com/kohsuke/args4j/blob/master/args4j/src/org/kohsuke/args4j/spi/SubCommand.java
 
https://github.com/AndoxynPlugins/SubCommandPluginExample


was (Author: ajayydv):
This is what quick search about word convention done shows:
{quote}"a way in which something is usually done, especially within a 
particular area or activity."{quote}
In example you gave first example about input/output falls in that category but 
i don;t think so about the subcommand. I quick search into git will give you 
many examples of subcommand being camel-cased. 

https://github.com/kohsuke/args4j/blob/master/args4j/src/org/kohsuke/args4j/spi/SubCommand.java
 
https://github.com/AndoxynPlugins/SubCommandPluginExample

> 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, 
> HDDS-379.003.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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDDS-379) Simplify and improve the cli arg parsing of ozone scmcli

2018-08-30 Thread Ajay Kumar (JIRA)


[ 
https://issues.apache.org/jira/browse/HDDS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16597819#comment-16597819
 ] 

Ajay Kumar edited comment on HDDS-379 at 8/30/18 8:12 PM:
--

Not a language expert either so this looks like subjective suggestion. I don't 
feel strongly about it but its a compound word. 


was (Author: ajayydv):
Not a language expert either so this looks like subjective suggestion. I don't 
feel strongly about it but it its a compound word. 

> 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, 
> HDDS-379.003.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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDDS-379) Simplify and improve the cli arg parsing of ozone scmcli

2018-08-30 Thread Anu Engineer (JIRA)


[ 
https://issues.apache.org/jira/browse/HDDS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16597751#comment-16597751
 ] 

Anu Engineer edited comment on HDDS-379 at 8/30/18 6:24 PM:


Not a language lawyer nor a native language speaker, But it looks like 
subcommand by convention is used as a single word. If we agree then initial 
usage of {{CreateSubcommand}} seems to be correct CamelCasing.

 

Ref: https://en.wiktionary.org/wiki/subcommand


was (Author: anu):
Not a language lawyer nor a native language speaker, But it looks like 
subcommand by convention is used as a single word. If we agree then initial 
usage of {{CreateSubcommand}} seems to be correct CamelCasing. 

> 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, 
> HDDS-379.003.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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org