hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elek, Marton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-12002) Ozone : SCM cli misc fixes/improvements
Date Tue, 20 Jun 2017 22:57:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-12002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16056613#comment-16056613

Elek, Marton commented on HDFS-12002:

+1: I suggest to print out the exception message in case of any error:

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/Shell.java
index c0d3651b0bb..733fc6f7b3d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/Shell.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/Shell.java
@@ -105,6 +105,8 @@ public static void main(String[] argv) throws Exception {
     try {
       res = ToolRunner.run(shell, argv);
     } catch (Exception ex) {
+      System.err.println("ERROR: " + ex.getMessage());

I had no hadoop-site.xml (it's not required to run scm/ksm/namenode/datanode) and currently
without that the cli couldn't be started. (And no error message at all).

> Ozone : SCM cli misc fixes/improvements
> ---------------------------------------
>                 Key: HDFS-12002
>                 URL: https://issues.apache.org/jira/browse/HDFS-12002
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Chen Liang
>            Assignee: Chen Liang
>             Fix For: ozone
> Currently there are a few minor issues with the SCM CLI:
> 1. some commands do not use -c option to take container name. an issue with this is that
arguments need to be in a certain order to be correctly parsed, e.g.:
> {{./bin/hdfs scm -container -del c0 -f}} works, but
> {{./bin/hdfs scm -container -del -f c0}} will not
> A more important thing is that, since -del requires the following argument being container
name, if someone types {{./bin/hdfs scm -container -del -help}} it will be an error, while
we probably want to display a help message instead.
> 2.some subcommands are not displaying the errors in the best way it could be, e.g.:
> {{./bin/hdfs scm -container -del}} is wrong because it misses container name. So cli
> {code}
> Missing argument for option: del
> Unrecognized options:[-container, -del]
> usage: hdfs scm <commands> [<options>]
> where <commands> can be one of the following
>  -container   Container related options
> {code}
> but this does not really show that it is container name it is missing
> 3. probably better to rename -del to -delete to be consistent with other commands like
-create and -info
> 4. when passing in invalid argument e.g. -info on a non-existing container, an exception
will be displayed. We probably should not scare the users, and only display just one error
message. And move the exception display to debug mode display or something.

This message was sent by Atlassian JIRA

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

View raw message