hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1161329 - in /hadoop/common/trunk/hadoop-common: ./ src/main/bin/
Date Thu, 25 Aug 2011 00:06:54 GMT
Author: acmurthy
Date: Thu Aug 25 00:06:53 2011
New Revision: 1161329

URL: http://svn.apache.org/viewvc?rev=1161329&view=rev
Log:
HADOOP-7563. Setup HADOOP_HDFS_HOME, HADOOP_MAPRED_HOME and classpath correction. Contributed
by Eric Yang. 

Modified:
    hadoop/common/trunk/hadoop-common/CHANGES.txt
    hadoop/common/trunk/hadoop-common/src/main/bin/hadoop
    hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-config.sh
    hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemon.sh
    hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemons.sh
    hadoop/common/trunk/hadoop-common/src/main/bin/rcc
    hadoop/common/trunk/hadoop-common/src/main/bin/slaves.sh
    hadoop/common/trunk/hadoop-common/src/main/bin/start-all.sh
    hadoop/common/trunk/hadoop-common/src/main/bin/stop-all.sh

Modified: hadoop/common/trunk/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/CHANGES.txt?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-common/CHANGES.txt Thu Aug 25 00:06:53 2011
@@ -522,6 +522,9 @@ Trunk (unreleased changes)
     HADOOP-7567. 'mvn eclipse:eclipse' fails for hadoop-alfredo (auth).
     (Alejandro Abdelnur via tomwhite)
 
+    HADOOP-7563. Setup HADOOP_HDFS_HOME, HADOOP_MAPRED_HOME and classpath
+    correction. (Eric Yang via acmurthy) 
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/hadoop
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/hadoop?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/hadoop (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/hadoop Thu Aug 25 00:06:53 2011
@@ -21,11 +21,7 @@ bin=`which $0`
 bin=`dirname ${bin}`
 bin=`cd "$bin"; pwd`
  
-if [ -e "$bin/../libexec/hadoop-config.sh" ]; then
-  . "$bin"/../libexec/hadoop-config.sh
-else
-  . "$bin"/hadoop-config.sh
-fi
+. "$bin"/../libexec/hadoop-config.sh
 
 function print_usage(){
   echo "Usage: hadoop [--config confdir] COMMAND"

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-config.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-config.sh?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-config.sh (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-config.sh Thu Aug 25 00:06:53 2011
@@ -139,64 +139,19 @@ fi
 # CLASSPATH initially contains $HADOOP_CONF_DIR
 CLASSPATH="${HADOOP_CONF_DIR}"
 
-# for developers, add Hadoop classes to CLASSPATH
-if [ -d "$HADOOP_PREFIX/build/classes" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build/classes
-fi
-if [ -d "$HADOOP_PREFIX/build/webapps" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build
-fi
-if [ -d "$HADOOP_PREFIX/build/test/classes" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build/test/classes
-fi
-if [ -d "$HADOOP_PREFIX/build/test/core/classes" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build/test/core/classes
-fi
-
 # so that filenames w/ spaces are handled correctly in loops below
 IFS=
 
 # for releases, add core hadoop jar & webapps to CLASSPATH
-if [ -d "$HADOOP_PREFIX/webapps" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX
+if [ -d "$HADOOP_PREFIX/share/hadoop/common/webapps" ]; then
+  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/share/hadoop/common/webapps
 fi
 
 if [ -d "$HADOOP_PREFIX/share/hadoop/common/lib" ]; then
-  for f in $HADOOP_PREFIX/share/hadoop/common/lib/*.jar; do
-    CLASSPATH=${CLASSPATH}:$f;
-  done
+  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/share/hadoop/common/lib'/*'
 fi
 
-for f in $HADOOP_PREFIX/share/hadoop/common/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
-# for developers, add libs to CLASSPATH
-for f in $HADOOP_PREFIX/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
-if [ -d "$HADOOP_PREFIX/build/ivy/lib/Hadoop-Common/common" ]; then
-for f in $HADOOP_PREFIX/build/ivy/lib/Hadoop-Common/common/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-fi
-
-if [ -d "$HADOOP_PREFIX/build/ivy/lib/hadoop-hdfs/hdfs" ]; then
-for f in $HADOOP_PREFIX/build/ivy/lib/hadoop-hdfs/hdfs/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-fi
-
-if [ -d "$HADOOP_PREFIX/build/ivy/lib/Hadoop/mapred" ]; then
-for f in $HADOOP_PREFIX/build/ivy/lib/Hadoop/mapred/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-fi
-
-for f in $HADOOP_PREFIX/lib/jsp-2.1/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
+CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/share/hadoop/common'/*'
 
 # add user-specified CLASSPATH last
 if [ "$HADOOP_CLASSPATH" != "" ]; then
@@ -274,37 +229,20 @@ HADOOP_OPTS="$HADOOP_OPTS -Djava.net.pre
 # put hdfs in classpath if present
 if [ "$HADOOP_HDFS_HOME" = "" ]; then
   if [ -d "${HADOOP_PREFIX}/share/hadoop/hdfs" ]; then
-    HADOOP_HDFS_HOME=$HADOOP_PREFIX/share/hadoop/hdfs
-    #echo Found HDFS installed at $HADOOP_HDFS_HOME
+    HADOOP_HDFS_HOME=$HADOOP_PREFIX
   fi
 fi
 
-if [ -d "${HADOOP_HDFS_HOME}" ]; then
+if [ -d "$HADOOP_HDFS_HOME/share/hadoop/hdfs/webapps" ]; then
+  CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME/share/hadoop/hdfs
+fi
 
-  if [ -d "$HADOOP_HDFS_HOME/webapps" ]; then
-    CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME
-  fi
-  
-  if [ ! -d "${HADOOP_CONF_DIR}" ] && [ -d "${HADOOP_HDFS_HOME}/conf" ]; then
-    CLASSPATH=${CLASSPATH}:${HADOOP_HDFS_HOME}/conf
-  fi
-  
-  for f in $HADOOP_HDFS_HOME/hadoop-hdfs-*.jar; do
-    CLASSPATH=${CLASSPATH}:$f;
-  done
-
-  # add libs to CLASSPATH
-  if [ -d "${HADOOP_HDFS_HOME}/lib" ]; then
-    for f in $HADOOP_HDFS_HOME/lib/*.jar; do
-      CLASSPATH=${CLASSPATH}:$f;
-    done
-  fi
-  
-  if [ -d "$HADOOP_HDFS_HOME/build/classes" ]; then
-    CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME/build/classes
-  fi
+if [ -d "$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib" ]; then
+  CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib'/*'
 fi
 
+CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME/share/hadoop/hdfs'/*'
+
 # cygwin path translation
 if $cygwin; then
   HADOOP_HDFS_HOME=`cygpath -w "$HADOOP_HDFS_HOME"`
@@ -313,44 +251,16 @@ fi
 # set mapred home if mapred is present
 if [ "$HADOOP_MAPRED_HOME" = "" ]; then
   if [ -d "${HADOOP_PREFIX}/share/hadoop/mapreduce" ]; then
-    HADOOP_MAPRED_HOME=$HADOOP_PREFIX/share/hadoop/mapreduce
+    HADOOP_MAPRED_HOME=$HADOOP_PREFIX
   fi
 fi
 
-if [ -d "${HADOOP_MAPRED_HOME}" ]; then
-
-  if [ -d "$HADOOP_MAPRED_HOME/webapps" ]; then
-    CLASSPATH=${CLASSPATH}:$HADOOP_MAPRED_HOME
-  fi
-
-  if [ ! -d "${HADOOP_CONF_DIR}" ] && [ -d "${HADOOP_MAPRED_HOME}/conf" ]; then
-    CLASSPATH=${CLASSPATH}:${HADOOP_MAPRED_HOME}/conf
-  fi
-  
-  for f in $HADOOP_MAPRED_HOME/hadoop-mapreduce-*.jar; do
-    CLASSPATH=${CLASSPATH}:$f
-  done
-
-  if [ -d "${HADOOP_MAPRED_HOME}/lib" ]; then
-    for f in $HADOOP_MAPRED_HOME/lib/*.jar; do
-      CLASSPATH=${CLASSPATH}:$f
-    done
-  fi
-
-  if [ -d "$HADOOP_MAPRED_HOME/build/classes" ]; then
-    CLASSPATH=${CLASSPATH}:$HADOOP_MAPRED_HOME/build/classes
-  fi
-
-  if [ -d "$HADOOP_MAPRED_HOME/build/tools" ]; then
-    CLASSPATH=${CLASSPATH}:$HADOOP_MAPRED_HOME/build/tools
-  fi
+if [ -d "$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/webapps" ]; then
+  CLASSPATH=${CLASSPATH}:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/webapps
+fi
 
-  for f in $HADOOP_MAPRED_HOME/hadoop-mapreduce-tools-*.jar; do
-    TOOL_PATH=${TOOL_PATH}:$f;
-  done
-  for f in $HADOOP_MAPRED_HOME/build/hadoop-mapreduce-tools-*.jar; do
-    TOOL_PATH=${TOOL_PATH}:$f;
-  done
+if [ -d "$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib" ]; then
+  CLASSPATH=${CLASSPATH}:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib'/*'
 fi
 
 # cygwin path translation

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemon.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemon.sh?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemon.sh (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemon.sh Thu Aug 25 00:06:53 2011
@@ -39,11 +39,7 @@ fi
 bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 
-if [ -e "$bin/../libexec/hadoop-config.sh" ]; then
-  . "$bin"/../libexec/hadoop-config.sh
-else
-  . "$bin"/hadoop-config.sh
-fi
+. "$bin"/../libexec/hadoop-config.sh
 
 # get arguments
 

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemons.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemons.sh?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemons.sh (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/hadoop-daemons.sh Thu Aug 25 00:06:53 2011
@@ -29,10 +29,6 @@ fi
 bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 
-if [ -e "$bin/../libexec/hadoop-config.sh" ]; then
-  . "$bin"/../libexec/hadoop-config.sh
-else
-  . "$bin"/hadoop-config.sh
-fi
+. "$bin"/../libexec/hadoop-config.sh
 
 exec "$bin/slaves.sh" --config $HADOOP_CONF_DIR cd "$HADOOP_PREFIX" \; "$bin/hadoop-daemon.sh"
--config $HADOOP_CONF_DIR "$@"

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/rcc
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/rcc?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/rcc (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/rcc Thu Aug 25 00:06:53 2011
@@ -50,40 +50,6 @@ fi
 JAVA=$JAVA_HOME/bin/java
 JAVA_HEAP_MAX=-Xmx1000m 
 
-# CLASSPATH initially contains $HADOOP_CONF_DIR
-CLASSPATH="${HADOOP_CONF_DIR}"
-
-# for developers, add Hadoop classes to CLASSPATH
-if [ -d "$HADOOP_PREFIX/build/classes" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build/classes
-fi
-if [ -d "$HADOOP_PREFIX/build/webapps" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build
-fi
-if [ -d "$HADOOP_PREFIX/build/test/classes" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX/build/test/classes
-fi
-
-# so that filenames w/ spaces are handled correctly in loops below
-IFS=
-
-# for releases, add core hadoop jar & webapps to CLASSPATH
-if [ -d "$HADOOP_PREFIX/webapps" ]; then
-  CLASSPATH=${CLASSPATH}:$HADOOP_PREFIX
-fi
-for f in $HADOOP_PREFIX/hadoop-*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
-# add libs to CLASSPATH
-for f in $HADOOP_PREFIX/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
-for f in $HADOOP_PREFIX/lib/jetty-ext/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
 # restore ordinary behaviour
 unset IFS
 

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/slaves.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/slaves.sh?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/slaves.sh (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/slaves.sh Thu Aug 25 00:06:53 2011
@@ -38,11 +38,7 @@ fi
 bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 
-if [ -e "$bin/../libexec/hadoop-config.sh" ]; then
-  . "$bin"/../libexec/hadoop-config.sh
-else
-  . "$bin"/hadoop-config.sh
-fi
+. "$bin"/../libexec/hadoop-config.sh
 
 if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
   . "${HADOOP_CONF_DIR}/hadoop-env.sh"

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/start-all.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/start-all.sh?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/start-all.sh (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/start-all.sh Thu Aug 25 00:06:53 2011
@@ -23,11 +23,7 @@ echo "This script is Deprecated. Instead
 bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 
-if [ -e "$bin/../libexec/hadoop-config.sh" ]; then
-  . "$bin"/../libexec/hadoop-config.sh
-else
-  . "$bin"/hadoop-config.sh
-fi
+. "$bin"/../libexec/hadoop-config.sh
 
 # start hdfs daemons if hdfs is present
 if [ -f "${HADOOP_HDFS_HOME}"/bin/start-dfs.sh ]; then

Modified: hadoop/common/trunk/hadoop-common/src/main/bin/stop-all.sh
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/bin/stop-all.sh?rev=1161329&r1=1161328&r2=1161329&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/bin/stop-all.sh (original)
+++ hadoop/common/trunk/hadoop-common/src/main/bin/stop-all.sh Thu Aug 25 00:06:53 2011
@@ -23,11 +23,7 @@ echo "This script is Deprecated. Instead
 bin=`dirname "${BASH_SOURCE-$0}"`
 bin=`cd "$bin"; pwd`
 
-if [ -e "$bin/../libexec/hadoop-config.sh" ]; then
-  . "$bin"/../libexec/hadoop-config.sh
-else
-  . "$bin"/hadoop-config.sh
-fi
+. "$bin"/../libexec/hadoop-config.sh
 
 # stop hdfs daemons if hdfs is present
 if [ -f "${HADOOP_HDFS_HOME}"/bin/stop-dfs.sh ]; then



Mime
View raw message