From cb0a15d20180c7ca3799e63a2d53aa8dee800abd Mon Sep 17 00:00:00 2001 From: cnauroth Date: Mon, 19 Jan 2015 15:52:32 -0800 Subject: [PATCH] YARN-3015. yarn classpath command should support same options as hadoop classpath. Contributed by Varun Saxena. --- hadoop-yarn-project/CHANGES.txt | 3 +++ hadoop-yarn-project/hadoop-yarn/bin/yarn | 4 +--- hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd | 11 +++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index ea7a606a89..56709630f4 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -388,6 +388,9 @@ Release 2.7.0 - UNRELEASED YARN-3070. TestRMAdminCLI#testHelp fails for transitionToActive command. (Contributed by Junping Du) + YARN-3015. yarn classpath command should support same options as hadoop + classpath. (Contributed by Varun Saxena) + Release 2.6.0 - 2014-11-18 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 255082fa13..a1762881e9 100644 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -81,9 +81,7 @@ case "${COMMAND}" in set -- "${COMMAND}" "$@" ;; classpath) - hadoop_finalize - echo "${CLASSPATH}" - exit + hadoop_do_classpath_subcommand "$@" ;; daemonlog) CLASS=org.apache.hadoop.log.LogLevel diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd index b3286e23ce..3f68b16a07 100644 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd @@ -142,13 +142,16 @@ if "%1" == "--loglevel" ( set CLASSPATH=%CLASSPATH%;%HADOOP_YARN_HOME%\%YARN_LIB_JARS_DIR%\* if %yarn-command% == classpath ( - @echo %CLASSPATH% - goto :eof + if not defined yarn-command-arguments ( + @rem No need to bother starting up a JVM for this simple case. + @echo %CLASSPATH% + exit /b + ) ) set yarncommands=resourcemanager nodemanager proxyserver rmadmin version jar ^ application applicationattempt container node logs daemonlog historyserver ^ - timelineserver + timelineserver classpath for %%i in ( %yarncommands% ) do ( if %yarn-command% == %%i set yarncommand=true ) @@ -169,7 +172,7 @@ if "%1" == "--loglevel" ( goto :eof :classpath - @echo %CLASSPATH% + set CLASS=org.apache.hadoop.util.Classpath goto :eof :rmadmin