hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1080459 - in /hbase/trunk: CHANGES.txt bin/hbase
Date Fri, 11 Mar 2011 06:04:18 GMT
Author: stack
Date: Fri Mar 11 06:04:18 2011
New Revision: 1080459

URL: http://svn.apache.org/viewvc?rev=1080459&view=rev
Log:
HBASE-3533 Allow HBASE_LIBRARY_PATH env var to specify extra locations of native lib

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/bin/hbase

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1080459&r1=1080458&r2=1080459&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Fri Mar 11 06:04:18 2011
@@ -97,6 +97,8 @@ Release 0.91.0 - Unreleased
                causes tests not to run via not-maven
    HBASE-3513  upgrade thrift to 0.5.0 and use mvn version
    HBASE-3620  Make HBCK utility faster
+   HBASE-3533  Allow HBASE_LIBRARY_PATH env var to specify extra locations
+               of native lib
 
   TASK
    HBASE-3559  Move report of split to master OFF the heartbeat channel

Modified: hbase/trunk/bin/hbase
URL: http://svn.apache.org/viewvc/hbase/trunk/bin/hbase?rev=1080459&r1=1080458&r2=1080459&view=diff
==============================================================================
--- hbase/trunk/bin/hbase (original)
+++ hbase/trunk/bin/hbase Fri Mar 11 06:04:18 2011
@@ -34,6 +34,9 @@
 #   HBASE_HEAPSIZE   The maximum amount of heap to use, in MB. 
 #                    Default is 1000.
 #
+#   HBASE_LIBRARY_PATH  HBase additions to JAVA_LIBRARY_PATH for adding
+#                    native libaries.
+#
 #   HBASE_OPTS       Extra Java runtime options.
 #
 #   HBASE_CONF_DIR   Alternate conf dir. Default is ${HBASE_HOME}/conf.
@@ -181,21 +184,26 @@ if $cygwin; then
   HBASE_HOME=`cygpath -d "$HBASE_HOME"`
   HBASE_LOG_DIR=`cygpath -d "$HBASE_LOG_DIR"`
 fi
+
+function append_path() {
+  if [ -z "$1" ]; then
+    echo $2
+  else
+    echo $1:$2
+  fi
+}
+
 # setup 'java.library.path' for native-hadoop code if necessary
-JAVA_LIBRARY_PATH=''
+JAVA_LIBRARY_PATH="$HBASE_LIBRARY_PATH"
 if [ -d "${HBASE_HOME}/build/native" -o -d "${HBASE_HOME}/lib/native" ]; then
   JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName | sed
-e "s/ /_/g"`
 
   if [ -d "$HBASE_HOME/build/native" ]; then
-    JAVA_LIBRARY_PATH=${HBASE_HOME}/build/native/${JAVA_PLATFORM}/lib
+    JAVA_LIBRARY_PATH=$(append_path "$JAVA_LIBRARY_PATH" ${HBASE_HOME}/build/native/${JAVA_PLATFORM}/lib)
   fi
 
   if [ -d "${HBASE_HOME}/lib/native" ]; then
-    if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
-      JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:${HBASE_HOME}/lib/native/${JAVA_PLATFORM}
-    else
-      JAVA_LIBRARY_PATH=${HBASE_HOME}/lib/native/${JAVA_PLATFORM}
-    fi
+    JAVA_LIBRARY_PATH=$(append_path "$JAVA_LIBRARY_PATH" ${HBASE_HOME}/lib/native/${JAVA_PLATFORM})
   fi
 fi
 



Mime
View raw message