You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2013/04/20 19:58:12 UTC

svn commit: r1470208 - in /pig/trunk: CHANGES.txt bin/pig

Author: daijy
Date: Sat Apr 20 17:58:11 2013
New Revision: 1470208

URL: http://svn.apache.org/r1470208
Log:
PIG-2786: enhance Pig launcher script wrt. HBase/HCat integration

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

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1470208&r1=1470207&r2=1470208&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sat Apr 20 17:58:11 2013
@@ -28,6 +28,8 @@ PIG-3174:  Remove rpm and deb artifacts 
 
 IMPROVEMENTS
 
+PIG-2786: enhance Pig launcher script wrt. HBase/HCat integration (ndimiduk via daijy)
+
 PIG-3198: Let users use any function from PigType -> PigType as if it were builtlin (jcoveney)
 
 PIG-3268: Case statement support (cheolsoo)

Modified: pig/trunk/bin/pig
URL: http://svn.apache.org/viewvc/pig/trunk/bin/pig?rev=1470208&r1=1470207&r2=1470208&view=diff
==============================================================================
--- pig/trunk/bin/pig (original)
+++ pig/trunk/bin/pig Sat Apr 20 17:58:11 2013
@@ -41,8 +41,11 @@
 #
 #     PIG_CONF_DIR    Alternate conf dir. Default is ${PIG_HOME}/conf.
 #
+#     HBASE_HOME       Optionally, the HBase installation directory.
+#                      Defaults to ${PIG_HOME}/share/hbase
+#
 #     HBASE_CONF_DIR - Optionally, the HBase configuration to run against
-#                      when using HBaseStorage
+#                      when using HBaseStorage. Defaults to ${HBASE_HOME}/conf
 
 cygwin=false
 case "`uname`" in
@@ -279,8 +282,17 @@ if [ -z "$HADOOP_BIN" ]; then
     fi
 fi
 
-# if using HBase, likely want to include HBase config
-HBASE_CONF_DIR=${HBASE_CONF_DIR:-/etc/hbase}
+# if using HBase, likely want to include HBase jars and config
+HBH=${HBASE_HOME:-"${PIG_HOME}/share/hbase"}
+if [ -d "${HBH}" ]; then
+    for f in ${HBH}/hbase-*.jar; do
+        CLASSPATH=${CLASSPATH}:$f
+    done
+    for f in ${HBH}/lib/*.jar; do
+        CLASSPATH=${CLASSPATH}:$f
+    done
+    HBASE_CONF_DIR=${HBASE_CONF_DIR:-"${HBH}/conf"}
+fi
 if [ -n "$HBASE_CONF_DIR" ] && [ -d "$HBASE_CONF_DIR" ]; then
     CLASSPATH=$HBASE_CONF_DIR:$CLASSPATH
 fi
@@ -297,14 +309,6 @@ if [ -d "$ZKH" ] ; then
     done
 fi
 
-# locate HBase
-HBH=${HBASE_HOME:-"${PIG_HOME}/share/hbase"}
-if [ -d "$HBH" ]; then
-    for f in ${HBH}/hbase-*.jar; do
-        CLASSPATH=${CLASSPATH}:$f
-    done
-fi
-
 # default log directory & file
 if [ "$PIG_LOG_DIR" = "" ]; then
     PIG_LOG_DIR="$PIG_HOME/logs"