[
https://issues.apache.org/jira/browse/HADOOP-9626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13769374#comment-13769374
]
Steve Loughran commented on HADOOP-9626:
----------------------------------------
# Its complex with an interface -we have to deal with the special case that
someone wants to terminate with something that isn't an exception. Or we take a
throwable and just look for that interface
# I'm currently passing down ExitExceptions as they are what carries the exit
code. If we add a new interface then yes, I could throw new exceptions. the
nice thing about the current approach is that it doesn't change any public
interfaces.
# -1 to an enum, as there are 255 exit codes and different bits of code can
generate different codes with different meanings
As an example, YARN uses exit codes 1 and 2 for different meanings; #1 is
"client initiated shutdown *without failures*:
[https://github.com/hortonworks/hoya/blob/master/src/main/java/org/apache/hadoop/yarn/service/launcher/LauncherExitCodes.java].
I have to translate a "1" coming off HBase or Accumulo into a failure code,
which I do by having 64+ allocated to an AM-specific set of failure codes:
[https://github.com/hortonworks/hoya/blob/master/src/main/java/org/apache/hadoop/hoya/HoyaExitCodes.java]
> Add an interface for any exception to serve up an Exit code
> -----------------------------------------------------------
>
> Key: HADOOP-9626
> URL: https://issues.apache.org/jira/browse/HADOOP-9626
> Project: Hadoop Common
> Issue Type: Improvement
> Components: util
> Affects Versions: 2.1.0-beta
> Reporter: Steve Loughran
> Priority: Minor
> Attachments: HADOOP-9626-001.patch
>
>
> Various exception included exit codes, specifically
> {{Shell.ExitCodeException}}, {{ExitUtils.ExitException()}}.
> If all exceptions that wanted to pass up an exit code to the main method
> implemented an interface with the method {{int getExitCode()}}, it'd be
> easier to extract exit codes from these methods in a unified way, so
> generating the desired exit codes on the application itself
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira