You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/07/30 13:36:52 UTC

[GitHub] [hadoop-ozone] elek opened a new pull request #1276: HDDS-4046. Extensible subcommands for CLI applications

elek opened a new pull request #1276:
URL: https://github.com/apache/hadoop-ozone/pull/1276


   ## What changes were proposed in this pull request?
   
   
   
   HDDS-3814 proposed a new subcommand which deletes the column families from the rocksdb tables.
   
   But during the discussion there was no consensus if it's safe to add or not.
   
   This patch makes the sub-commands easy to extend. Anybody can extend the main ozone shell commands with new sub-commands.
   
   Sub-commands can be added to the classpath and activated by Service Provider Interface (meta-inf/services/...).
   
   This is an optional feature, current approach works forward (annotation based sub-command definition).
   
   And it's not only about HDDS-3814.
   
   It makes it easier to organize the sub-commands. (For example RDBStore related commands can be moved to the rdb classes, they will be picked up).
   
   It makes possible to provide additional, ad-hoc tools during debug or support which can help to solve/debug specific problems.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4046
   
   ## How was this patch tested?
   
   With CI. The changed subcommands are covered by acceptance tests. Also tested manually with `ozone sh`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #1276: HDDS-4046. Extensible subcommands for CLI applications

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1276:
URL: https://github.com/apache/hadoop-ozone/pull/1276#discussion_r467969399



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java
##########
@@ -50,7 +51,7 @@
     subcommands = {
         GetServiceRolesSubcommand.class
     })
-public class OMAdmin extends GenericCli {
+public class OMAdmin extends GenericCli implements SubcommandWithParent {

Review comment:
       Yes, it's missing. :eagle: :eye: :trophy: 
   
   Also, I can remove the `OmAdmin` from the annotations of `OzoneAdmin`. (Fortunately annotations and subcommands added programmatically can work together).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on pull request #1276: HDDS-4046. Extensible subcommands for CLI applications

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #1276:
URL: https://github.com/apache/hadoop-ozone/pull/1276#issuecomment-671747480


   Thanks @elek for updating the patch.  Tested that `ozone admin` lists `om` as subcommand and `ozone admin om` works.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai merged pull request #1276: HDDS-4046. Extensible subcommands for CLI applications

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #1276:
URL: https://github.com/apache/hadoop-ozone/pull/1276


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #1276: HDDS-4046. Extensible subcommands for CLI applications

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #1276:
URL: https://github.com/apache/hadoop-ozone/pull/1276#discussion_r464352920



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java
##########
@@ -50,7 +51,7 @@
     subcommands = {
         GetServiceRolesSubcommand.class
     })
-public class OMAdmin extends GenericCli {
+public class OMAdmin extends GenericCli implements SubcommandWithParent {

Review comment:
       Won't we need
   
   ```
   @MetaInfServices(SubcommandWithParent.class)
   ```
   
   too?
   
   Currently `OMAdmin` is added to `OzoneAdmin` from the parent, so it's not a problem.  (#1285 will allow inverting subcommand registration for `OzoneAdmin`, too.)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org