You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Andrzej Bialecki (JIRA)" <ji...@apache.org> on 2006/08/29 21:47:27 UTC
[jira] Updated: (HADOOP-488) Change ToolBase.doMain() to return a
status code
[ http://issues.apache.org/jira/browse/HADOOP-488?page=all ]
Andrzej Bialecki updated HADOOP-488:
-------------------------------------
Attachment: patch.txt
Patch that implements the return value, and changes tools to use this value as a System.exit() code. If there are no objections I'll apply this.
> Change ToolBase.doMain() to return a status code
> ------------------------------------------------
>
> Key: HADOOP-488
> URL: http://issues.apache.org/jira/browse/HADOOP-488
> Project: Hadoop
> Issue Type: Improvement
> Affects Versions: 0.6.0
> Reporter: Andrzej Bialecki
> Fix For: 0.6.0
>
> Attachments: patch.txt
>
>
> I propose to change the signature of ToolBase.doMain from this:
> public final void doMain(Configuration conf, String[] args) throws Exception;
> to this:
> public final int doMain(Configuration conf, String[] args) throws Exception;
> and then change main() methods of all classes that use ToolBase.doMain to call System.exit(code), where "code" is this return value from doMain(). All command-line tools, which still call main() methods of other tools, should be converted to use doMain() and return exit codes properly.
> The main reason for this change is that returning varying exit codes is required for proper operation of shell scripts, especially differing between code == 0 (normal exit) and code != 0 (error exit).
> Additionally, current implementation of doMain() already gets the return code, it just silently discards it (ToolBase.java:184).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira