From 81a7ad45c9b3f38a4b99e897bb304c362fb1bdf5 Mon Sep 17 00:00:00 2001 From: Allen Wittenauer Date: Tue, 1 Dec 2015 08:15:33 -0800 Subject: [PATCH] HADOOP-12366. expose calculated paths (aw) --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../hadoop-common/src/main/bin/hadoop | 10 ++++++++++ hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs | 9 +++++++++ hadoop-mapreduce-project/bin/mapred | 9 +++++++++ hadoop-yarn-project/hadoop-yarn/bin/yarn | 9 +++++++++ 5 files changed, 39 insertions(+) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index aab2524bdfa..af79ef6dd06 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -36,6 +36,8 @@ Release 2.8.0 - UNRELEASED HADOOP-10300. Allowed deferred sending of call responses. (Daryn Sharp via yliu) + HADOOP-12366. expose calculated paths (aw) + IMPROVEMENTS HADOOP-12458. Retries is typoed to spell Retires in parts of diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop index 1575996bbb9..44be2e34f8b 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop @@ -38,6 +38,7 @@ function print_usage(){ 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 " envvars display computed Hadoop environment variables" echo " archive -archiveName NAME -p * create a hadoop archive" echo " classpath prints the class path needed to get the" echo " Hadoop jar and the required libraries" @@ -116,6 +117,15 @@ case $COMMAND in CLASSPATH=${CLASSPATH}:${TOOL_PATH} elif [ "$COMMAND" = "daemonlog" ] ; then CLASS=org.apache.hadoop.log.LogLevel + elif [ "$COMMAND" = "envvars" ] ; then + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_COMMON_HOME='${HADOOP_COMMON_HOME}'" + echo "HADOOP_COMMON_DIR='${HADOOP_COMMON_DIR}'" + echo "HADOOP_COMMON_LIB_JARS_DIR='${HADOOP_COMMON_LIB_JARS_DIR}'" + echo "HADOOP_COMMON_LIB_NATIVE_DIR='${HADOOP_COMMON_LIB_NATIVE_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${TOOL_PATH}'" + exit 0 elif [ "$COMMAND" = "archive" ] ; then CLASS=org.apache.hadoop.tools.HadoopArchives CLASSPATH=${CLASSPATH}:${TOOL_PATH} diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs index fbfbaf2568f..714280e6a54 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs @@ -47,6 +47,7 @@ function print_usage(){ echo " datanode run a DFS datanode" echo " debug run a Debug Admin to execute HDFS debug commands" echo " dfsadmin run a DFS admin client" + echo " envvars display computed Hadoop environment variables" echo " haadmin run a DFS HA admin client" echo " fsck run a DFS filesystem checking utility" echo " balancer run a cluster balancing utility" @@ -161,6 +162,14 @@ elif [ "$COMMAND" = "haadmin" ] ; then CLASS=org.apache.hadoop.hdfs.tools.DFSHAAdmin CLASSPATH=${CLASSPATH}:${TOOL_PATH} HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS" +elif [ "$COMMAND" = "envvars" ] ; then + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_HDFS_HOME='${HADOOP_HDFS_HOME}'" + echo "HDFS_DIR='${HDFS_DIR}'" + echo "HDFS_LIB_JARS_DIR='${HDFS_LIB_JARS_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${TOOL_PATH}'" + exit 0 elif [ "$COMMAND" = "fsck" ] ; then CLASS=org.apache.hadoop.hdfs.tools.DFSck HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS" diff --git a/hadoop-mapreduce-project/bin/mapred b/hadoop-mapreduce-project/bin/mapred index 6f3bc04baf9..fd1300d67f7 100755 --- a/hadoop-mapreduce-project/bin/mapred +++ b/hadoop-mapreduce-project/bin/mapred @@ -38,6 +38,7 @@ function print_usage(){ echo " mapreduce subcommands" echo " historyserver run job history servers as a standalone daemon" echo " distcp copy file or directories recursively" + echo " envvars display computed Hadoop environment variables" echo " archive -archiveName NAME -p * create a hadoop archive" echo " archive-logs combine aggregated logs into hadoop archives" echo " hsadmin job history server admin interface" @@ -75,6 +76,14 @@ elif [ "$COMMAND" = "sampler" ] ; then HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS" elif [ "$COMMAND" = "classpath" ] ; then echo -n +elif [ "$COMMAND" = "envvars" ] ; then + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_MAPRED_HOME='${HADOOP_MAPRED_HOME}'" + echo "MAPRED_DIR='${MAPRED_DIR}'" + echo "MAPRED_LIB_JARS_DIR='${MAPRED_LIB_JARS_DIR}'" + echo "HADOOP_CONF_DIR=${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${TOOL_PATH}'" + exit 0 elif [ "$COMMAND" = "historyserver" ] ; then CLASS=org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer HADOOP_OPTS="$HADOOP_OPTS -Dmapred.jobsummary.logger=${HADOOP_JHS_LOGGER:-INFO,console} $HADOOP_JOB_HISTORYSERVER_OPTS" diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 552cef41fae..5495387503c 100644 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -89,6 +89,7 @@ function print_usage(){ echo " cluster prints cluster information" echo " daemonlog get/set the log level for each" echo " daemon" + echo " envvars display computed Hadoop environment variables" echo " top run cluster usage tool" echo "" echo "Most commands print help when invoked w/o parameters." @@ -217,6 +218,14 @@ if [ "$COMMAND" = "classpath" ] ; then echo $CLASSPATH exit 0 fi +elif [ "$COMMAND" = "envvars" ] ; then + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_YARN_HOME='${HADOOP_YARN_HOME}'" + echo "YARN_DIR='${YARN_DIR}'" + echo "YARN_LIB_JARS_DIR='${YARN_LIB_JARS_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${TOOL_PATH}'" + exit 0 elif [ "$COMMAND" = "rmadmin" ] ; then CLASS='org.apache.hadoop.yarn.client.cli.RMAdminCLI' YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"