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 cm...@apache.org on 2014/11/14 22:03:12 UTC

hadoop git commit: HADOOP-11257. Update "hadoop jar" documentation to warn against using it for launching yarn jars (iwasakims via cmccabe) (cherry picked from commit 10c98aed38430df5a18899b098c34f5874a798d4)

Repository: hadoop
Updated Branches:
  refs/heads/branch-2 00d135d75 -> 490df57fa


HADOOP-11257. Update "hadoop jar" documentation to warn against using it for launching yarn jars (iwasakims via cmccabe)
(cherry picked from commit 10c98aed38430df5a18899b098c34f5874a798d4)


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

Branch: refs/heads/branch-2
Commit: 490df57fa2087811c9150b85346a4f23c7df6200
Parents: 00d135d
Author: Colin Patrick Mccabe <cm...@cloudera.com>
Authored: Fri Nov 14 12:53:09 2014 -0800
Committer: Colin Patrick Mccabe <cm...@cloudera.com>
Committed: Fri Nov 14 12:56:31 2014 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/src/main/bin/hadoop       | 5 +++++
 hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd   | 7 +++++++
 .../hadoop-common/src/site/apt/CommandsManual.apt.vm          | 3 +++
 3 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/490df57f/hadoop-common-project/hadoop-common/src/main/bin/hadoop
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop
index fa0d981..c5b096f 100755
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop
@@ -31,6 +31,8 @@ function print_usage(){
   echo "  fs                   run a generic filesystem user client"
   echo "  version              print the version"
   echo "  jar <jar>            run a jar file"
+  echo "                       note: please use \"yarn jar\" to launch"
+  echo "                             YARN applications, not this command."
   echo "  checknative [-a|-h]  check native hadoop and compression libraries availability"
   echo "  distcp <srcurl> <desturl> copy file or directories recursively"
   echo "  archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive"
@@ -101,6 +103,9 @@ case $COMMAND in
       CLASS=org.apache.hadoop.util.VersionInfo
     elif [ "$COMMAND" = "jar" ] ; then
       CLASS=org.apache.hadoop.util.RunJar
+      if [[ -n "${YARN_OPTS}" ]] || [[ -n "${YARN_CLIENT_OPTS}" ]]; then
+        echo "WARNING: Use \"yarn jar\" to launch YARN applications."
+      fi
     elif [ "$COMMAND" = "key" ] ; then
       CLASS=org.apache.hadoop.crypto.key.KeyShell
     elif [ "$COMMAND" = "checknative" ] ; then

http://git-wip-us.apache.org/repos/asf/hadoop/blob/490df57f/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd b/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
index da68a7c..5cac64a 100644
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
@@ -157,6 +157,11 @@ call :updatepath %HADOOP_BIN_PATH%
   goto :eof
 
 :version 
+  if defined YARN_OPTS (
+    @echo WARNING: Use "yarn jar" to launch YARN applications.
+  ) else if defined YARN_CLIENT_OPTS (
+    @echo WARNING: Use "yarn jar" to launch YARN applications.
+  )
   set CLASS=org.apache.hadoop.util.VersionInfo
   goto :eof
 
@@ -241,6 +246,8 @@ call :updatepath %HADOOP_BIN_PATH%
   goto :MakeCmdArgsLoop 
   :EndLoop 
   set hadoop-command-arguments=%_arguments%
+  @echo                        note: please use "yarn jar" to launch
+  @echo                              YARN applications, not this command.
   goto :eof
 
 :print_usage

http://git-wip-us.apache.org/repos/asf/hadoop/blob/490df57f/hadoop-common-project/hadoop-common/src/site/apt/CommandsManual.apt.vm
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/site/apt/CommandsManual.apt.vm b/hadoop-common-project/hadoop-common/src/site/apt/CommandsManual.apt.vm
index 7771aa1..6d2fd5e 100644
--- a/hadoop-common-project/hadoop-common/src/site/apt/CommandsManual.apt.vm
+++ b/hadoop-common-project/hadoop-common/src/site/apt/CommandsManual.apt.vm
@@ -177,6 +177,9 @@ User Commands
    Word count example is also run using jar command. It can be referred from
    Wordcount example
 
+   Use {{{../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html#jar}<<<yarn jar>>>}}
+   to launch YARN applications instead.
+
 * <<<job>>>
 
    Deprecated. Use