From aa2f27725625aba532a2b19fbab8c3ead1429d32 Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Wed, 26 Nov 2014 12:17:48 -0800 Subject: [PATCH] HADOOP-11257. Update "hadoop jar" documentation to warn against using it for launching yarn jars (iwasakims via cmccabe) --- hadoop-common-project/hadoop-common/src/main/bin/hadoop | 5 +++++ .../hadoop-common/src/main/bin/hadoop.cmd | 7 +++++++ .../hadoop-common/src/site/apt/CommandsManual.apt.vm | 3 +++ 3 files changed, 15 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop index eccd3223517..9df2c7dfa89 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop @@ -33,6 +33,8 @@ function hadoop_usage() echo " copy file or directories recursively" echo " fs run a generic filesystem user client" echo " jar run a jar file" + echo " note: please use \"yarn jar\" to launch" + echo " YARN applications, not this command." echo " jnipath prints the java.library.path" echo " key manage keys via the KeyProvider" echo " trace view and modify Hadoop tracing settings" @@ -150,6 +152,9 @@ case ${COMMAND} in CLASS=org.apache.hadoop.fs.FsShell ;; jar) + if [[ -n "${YARN_OPTS}" ]] || [[ -n "${YARN_CLIENT_OPTS}" ]]; then + hadoop_error "WARNING: Use \"yarn jar\" to launch YARN applications." + fi CLASS=org.apache.hadoop.util.RunJar ;; jnipath) 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 fc2e9b743ae..f612ace7cca 100644 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd @@ -181,6 +181,11 @@ call :updatepath %HADOOP_BIN_PATH% goto :eof :jar + 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.RunJar goto :eof @@ -269,6 +274,8 @@ call :updatepath %HADOOP_BIN_PATH% @echo fs run a generic filesystem user client @echo version print the version @echo 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 ^ ^ copy file or directories recursively @echo archive -archiveName NAME -p ^ ^* ^ create a hadoop archive 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 7771aa13ff1..6d2fd5e2b7e 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}<<>>}} + to launch YARN applications instead. + * <<>> Deprecated. Use