diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e3aef609ed2..cd442dc7416 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -39,6 +39,9 @@ Release 2.0.5-beta - UNRELEASED HADOOP-9450. HADOOP_USER_CLASSPATH_FIRST is not honored; CLASSPATH is PREpended instead of APpended. (Chris Nauroth and harsh via harsh) + HADOOP-9496. Bad merge of HADOOP-9450 on branch-2 breaks all bin/hadoop + calls that need HADOOP_CLASSPATH. (harsh) + OPTIMIZATIONS HADOOP-9150. Avoid unnecessary DNS resolution attempts for logical URIs diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh index 647901d49a9..49390eb677c 100644 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh @@ -294,6 +294,18 @@ if [ "$HADOOP_MAPRED_HOME/$MAPRED_DIR" != "$HADOOP_YARN_HOME/$YARN_DIR" ] ; then CLASSPATH=${CLASSPATH}:$HADOOP_MAPRED_HOME/$MAPRED_DIR'/*' fi +# Add the user-specified CLASSPATH via HADOOP_CLASSPATH +# Add it first or last depending on if user has +# set env-var HADOOP_USER_CLASSPATH_FIRST +if [ "$HADOOP_CLASSPATH" != "" ]; then + # Prefix it if its to be preceded + if [ "$HADOOP_USER_CLASSPATH_FIRST" != "" ]; then + CLASSPATH=${HADOOP_CLASSPATH}:${CLASSPATH} + else + CLASSPATH=${CLASSPATH}:${HADOOP_CLASSPATH} + fi +fi + # cygwin path translation if $cygwin; then HADOOP_HDFS_HOME=`cygpath -w "$HADOOP_HDFS_HOME"` @@ -303,5 +315,3 @@ fi if $cygwin; then TOOL_PATH=`cygpath -p -w "$TOOL_PATH"` fi - -