hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Bialecki (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-488) Change ToolBase.doMain() to return a status code
Date Tue, 29 Aug 2006 17:22:23 GMT
    [ http://issues.apache.org/jira/browse/HADOOP-488?page=comments#action_12431297 ] 
            
Andrzej Bialecki  commented on HADOOP-488:
------------------------------------------

Thanks Michael, that was exactly the gist of my proposal; that's why I mentioned that all
places which now incorrectly use main() methods should call instead doMain().

If there's a tool that starts worker threads and then completes the main thread, I would advocate
that it should explicitly wait in its run(String[]) method until all threads complete, or
a timeout occurs.

> 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
>
>
> 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

        

Mime
View raw message