hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kai Sasaki (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11516) Admin command line should print message to stderr in failure case
Date Mon, 13 Mar 2017 13:11:42 GMT

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

Kai Sasaki commented on HDFS-11516:

[~andrew.wang] Thank you for comments.

if we're printing to stderr and it's a fatal error, shouldn't it also return a non-zero return
Ideally it should return a non-zero code I think. As described the document you introduced,
error such as invalid argument should be printed into stderr and 
other CLI like {{CryptCLI}} returns non-zero code.

    public int run(Configuration conf, List<String> args) throws IOException {
      final String path = StringUtils.popOptionWithArgument("-path", args);

      if (!args.isEmpty()) {
        System.err.println("Can't understand argument: " + args.get(0));
        return 1;

But in terms of return code it can affect client side, I think it might be necessary to take

it would be nice to test the error codes though.
I'll update to add test code to check error code.

> Admin command line should print message to stderr in failure case
> -----------------------------------------------------------------
>                 Key: HDFS-11516
>                 URL: https://issues.apache.org/jira/browse/HDFS-11516
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Kai Sasaki
>            Assignee: Kai Sasaki
>            Priority: Minor
>         Attachments: HDFS-11516.01.patch
> {{AdminHelper}} and {{CryptAdmin}} where prints message to stdout instead of stderr.
Since other failure cases prints to stderr, it is necessary to consolidate that manner.
> e.g.
> {code}
>       if (args.size() != 1) {
>         System.err.println("You must give exactly one argument to -help.");
>         return 0;
>       }
> {code}

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