[ 
https://issues.apache.org/jira/browse/HADOOP-10912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14091339#comment-14091339
 ] 

Allen Wittenauer commented on HADOOP-10912:
-------------------------------------------

Yup, HADOOP-9902 takes care of the relative path issue.  

A few things:

* Do we really want to make everyone switch from HADOOP_PREFIX back to 
HADOOP_HOME? I will admit I prefer HADOOP_HOME, but ....

* This pretty much removes support for hadoop-layout.sh .  I'm not sure that's 
safe to do, esp if this is targeting branch-2.

* So many readlinks.. but are they really necessary? i.e.: 

{code}
HADOOP_CONF_DIR=`readlink -f ${HADOOP_CONF_DIR:-"/etc/hadoop/conf"}`
{code}

If /etc/hadoop is a symlink, does it matter?  Plus, readlink isn't a built-in, 
so that's a lot of forks.

For the directory stuff:

{code}
  this="$(dirname -- "$(readlink -f -- "${BASH_SOURCE-$0}")")"
  export HADOOP_HOME="$(readlink -f -- "$this/../..")/hadoop"
{code}

 One of the advantages of doing:

{code}
  this="${BASH_SOURCE-$0}"
  bin=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd -P)
{code}

is that with the exception of dirname, those are all built-ins.  Those extra 
readlinks are going to be expensive.

* You don't need to set the classpath on the command:

{code}
+  exec "$JAVA_HOME/bin/java" -cp "$CLASSPATH" -Dproc_$COMMAND \
+       $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@" 
{code}

Before this line (waaaay up there in the case of HDFS) is an EXPORT CLASSPATH 
which the JVM will pick up.  This reduces the size of the command line so that 
it doesn't break the limit.




> Modify scripts to use relative paths
> ------------------------------------
>
>                 Key: HADOOP-10912
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10912
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: scripts
>            Reporter: Owen O'Malley
>         Attachments: hadoop-10912.path
>
>
> Make all of the scripts use relative paths for defaulting HADOOP_HOME and the 
> related paths. This is useful for any deployments that don't use 
> /usr/lib/hadoop as the prefix, including but not limited to tar ball 
> installations  and side by side installs.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to