You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aw...@apache.org on 2016/05/07 20:20:46 UTC
hadoop git commit: HADOOP-13115. dynamic subcommand docs should talk
about exit vs. continue program flow
Repository: hadoop
Updated Branches:
refs/heads/HADOOP-12930 452db29bd -> 795c5f15e
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/795c5f15
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/795c5f15
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/795c5f15
Branch: refs/heads/HADOOP-12930
Commit: 795c5f15eb63f6a56fd307cce69184abda0d4529
Parents: 452db29
Author: Allen Wittenauer <aw...@apache.org>
Authored: Sat May 7 13:20:39 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sat May 7 13:20:39 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/795c5f15/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