浏览代码

HADOOP-7869. HADOOP_HOME warning happens all of the time. Contributed by Owen O'Malley

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1208936 13f79535-47bb-0310-9956-ffa450edef68
Matthew Foley 13 年之前
父节点
当前提交
1d1321a689
共有 3 个文件被更改,包括 16 次插入10 次删除
  1. 3 0
      CHANGES.txt
  2. 0 9
      bin/hadoop
  3. 13 1
      bin/hadoop-config.sh

+ 3 - 0
CHANGES.txt

@@ -160,6 +160,9 @@ Release 1.0.0 - unreleased
 
 
   BUG FIXES
   BUG FIXES
 
 
+    HADOOP-7869. HADOOP_HOME warning happens all of the time (Owen O'Malley 
+    via mattf)
+
     HADOOP-7815. Fixed configuring map memory mb in hadoop-setup-conf.sh. 
     HADOOP-7815. Fixed configuring map memory mb in hadoop-setup-conf.sh. 
     (Ramya Sunil)
     (Ramya Sunil)
 
 

+ 0 - 9
bin/hadoop

@@ -56,11 +56,6 @@ else
   . "$bin"/hadoop-config.sh
   . "$bin"/hadoop-config.sh
 fi
 fi
 
 
-if [ "$HADOOP_HOME_WARN_SUPPRESS" == "" ] && [ "$HADOOP_HOME" != "" ]; then
-  echo "Warning: \$HADOOP_HOME is deprecated." 1>&2
-  echo 1>&2
-fi
-
 cygwin=false
 cygwin=false
 case "`uname`" in
 case "`uname`" in
 CYGWIN*) cygwin=true;;
 CYGWIN*) cygwin=true;;
@@ -103,10 +98,6 @@ fi
 COMMAND=$1
 COMMAND=$1
 shift
 shift
 
 
-if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
-  . "${HADOOP_CONF_DIR}/hadoop-env.sh"
-fi
-
 # Determine if we're starting a secure datanode, and if so, redefine appropriate variables
 # Determine if we're starting a secure datanode, and if so, redefine appropriate variables
 if [ "$COMMAND" == "datanode" ] && [ "$EUID" -eq 0 ] && [ -n "$HADOOP_SECURE_DN_USER" ]; then
 if [ "$COMMAND" == "datanode" ] && [ "$EUID" -eq 0 ] && [ -n "$HADOOP_SECURE_DN_USER" ]; then
   HADOOP_PID_DIR=$HADOOP_SECURE_DN_PID_DIR
   HADOOP_PID_DIR=$HADOOP_SECURE_DN_PID_DIR

+ 13 - 1
bin/hadoop-config.sh

@@ -32,7 +32,6 @@ this="$config_bin/$script"
 
 
 # the root of the Hadoop installation
 # the root of the Hadoop installation
 export HADOOP_PREFIX=`dirname "$this"`/..
 export HADOOP_PREFIX=`dirname "$this"`/..
-export HADOOP_HOME=${HADOOP_PREFIX}
 
 
 #check to see if the conf dir is given as an optional argument
 #check to see if the conf dir is given as an optional argument
 if [ $# -gt 1 ]
 if [ $# -gt 1 ]
@@ -66,3 +65,16 @@ then
         export HADOOP_SLAVES="${HADOOP_CONF_DIR}/$slavesfile"
         export HADOOP_SLAVES="${HADOOP_CONF_DIR}/$slavesfile"
     fi
     fi
 fi
 fi
+
+if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
+  . "${HADOOP_CONF_DIR}/hadoop-env.sh"
+fi
+
+if [ "$HADOOP_HOME_WARN_SUPPRESS" == "" ] && [ "$HADOOP_HOME" != "" ]; then
+  echo "Warning: \$HADOOP_HOME is deprecated." 1>&2
+  echo 1>&2
+fi
+
+export HADOOP_HOME=${HADOOP_PREFIX}
+export HADOOP_HOME_WARN_SUPPRESS=1
+