hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [14/31] hadoop git commit: HADOOP-13115. dynamic subcommand docs should talk about exit vs. continue program flow
Date Sun, 15 May 2016 14:50:54 GMT
HADOOP-13115. dynamic subcommand docs should talk about exit vs. continue program flow


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/55f1fec3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/55f1fec3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/55f1fec3

Branch: refs/heads/HADOOP-12930
Commit: 55f1fec38d176c3313c9de74ea3ba26253e5ed37
Parents: 9708a23
Author: Allen Wittenauer <aw@apache.org>
Authored: Sat May 7 13:20:39 2016 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Sun May 15 07:50:15 2016 -0700

----------------------------------------------------------------------
 .../hadoop-common/src/site/markdown/UnixShellGuide.md         | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/55f1fec3/hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md b/hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md
index 2c87480..4a28f6d 100644
--- a/hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md
+++ b/hadoop-common-project/hadoop-common/src/site/markdown/UnixShellGuide.md
@@ -121,6 +121,7 @@ Prior to executing a subcommand, the primary scripts will check for the
existanc
 function yarn_subcommand_hello
 {
   echo "$@"
+  exit $?
 }
 ```
 
@@ -159,7 +160,7 @@ Some key environment variables related to Dynamic Subcommands:
 
 * HADOOP\_CLASSNAME
 
-This is the name of the Java class to execute.
+This is the name of the Java class to use when program execution continues.
 
 * HADOOP\_SHELL\_EXECNAME
 
@@ -187,4 +188,6 @@ If this command can be executed as a daemon, set this to true.
 
 * HADOOP\_USER\_PARAMS
 
-This is the full content of the command line, prior to any parsing done. It will contain
flags such as `--debug`.  It MAY NOT be manipulated.
\ No newline at end of file
+This is the full content of the command line, prior to any parsing done. It will contain
flags such as `--debug`.  It MAY NOT be manipulated.
+
+The Apache Hadoop runtime facilities require functions exit if no further processing is required.
 For example, in the hello example above, Java and other facilities were not required so a
simple `exit $?` was sufficient.  However, if the function were to utilize `HADOOP\_CLASSNAME`,
then program execution must continue so that Java with the Apache Hadoop-specific parameters
will be launched against the given Java class. Another example would be in the case of an
unrecoverable error.  It is the function's responsbility to print an appropriate message (preferably
using the hadoop_error API call) and exit appropriately.


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


Mime
View raw message