You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by br...@apache.org on 2013/11/20 18:44:29 UTC

svn commit: r1543890 - in /hive/trunk/hcatalog: bin/hcat bin/hcat.py bin/hcat_server.py bin/hcat_server.sh bin/hcatcfg.py webhcat/svr/src/main/bin/webhcat_config.sh webhcat/svr/src/main/bin/webhcat_server.sh

Author: brock
Date: Wed Nov 20 17:44:28 2013
New Revision: 1543890

URL: http://svn.apache.org/r1543890
Log:
HIVE-5842 - Fix issues with new paths to jar in hcatalog (Brock Noland reviewed by Prasad Mujumdar)

Modified:
    hive/trunk/hcatalog/bin/hcat
    hive/trunk/hcatalog/bin/hcat.py
    hive/trunk/hcatalog/bin/hcat_server.py
    hive/trunk/hcatalog/bin/hcat_server.sh
    hive/trunk/hcatalog/bin/hcatcfg.py
    hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh
    hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_server.sh

Modified: hive/trunk/hcatalog/bin/hcat
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/bin/hcat?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/bin/hcat (original)
+++ hive/trunk/hcatalog/bin/hcat Wed Nov 20 17:44:28 2013
@@ -17,23 +17,23 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Resolve our absolute path                                                      
-# resolve links - $0 may be a softlink                                           
-this="${BASH_SOURCE-$0}"                                                         
-while [ -h "$this" ]; do                                                         
-    ls=`ls -ld "$this"`                                                          
-    link=`expr "$ls" : '.*-> \(.*\)$'`                                           
-    if expr "$link" : '.*/.*' > /dev/null; then                                  
-        this="$link"                                                             
-    else                                                                         
-        this=`dirname "$this"`/"$link"                                           
-    fi                                                                           
-done                                                                             
-                                                                                 
-# convert relative path to absolute path                                         
-bin=`dirname "$this"`                                                            
-script=`basename "$this"`                                                        
-bin=`unset CDPATH; cd "$bin"; pwd`                                               
+# Resolve our absolute path
+# resolve links - $0 may be a softlink
+this="${BASH_SOURCE-$0}"
+while [ -h "$this" ]; do
+    ls=`ls -ld "$this"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+        this="$link"
+    else
+        this=`dirname "$this"`/"$link"
+    fi
+done
+
+# convert relative path to absolute path
+bin=`dirname "$this"`
+script=`basename "$this"`
+bin=`unset CDPATH; cd "$bin"; pwd`
 this="$bin/$script"
 #to preserve value of 'this' since any other file that defines 'this' and is sourced
 #here (e.g. hcat-config.sh) will overwrite it
@@ -113,11 +113,11 @@ fi
 
 # Find our hcatalog jar
 shopt -s extglob
-if [ "$(ls -1 $HCAT_PREFIX/share/hcatalog/hcatalog-core-[0-9]*.jar | wc -l)" -ne 1 ]; then
-    echo "Error: did not find exactly one hcatalog-core jar in $HCAT_PREFIX/share/hcatalog"
+if [ "$(ls -1 $HCAT_PREFIX/share/hcatalog/hive-hcatalog-core-[0-9]*.jar | wc -l)" -ne 1 ]; then
+    echo "Error: did not find exactly one hive-hcatalog-core jar in $HCAT_PREFIX/share/hcatalog"
     exit 1
 fi
-HCAT_JAR=`ls $HCAT_PREFIX/share/hcatalog/hcatalog-core-[0-9]*.jar`
+HCAT_JAR=`ls $HCAT_PREFIX/share/hcatalog/hive-hcatalog-core-[0-9]*.jar`
 
 # Find the storage-handler jars.
 for jar in ${HCAT_PREFIX}/share/hcatalog/storage-handlers/*/lib/*.jar ; do
@@ -137,7 +137,7 @@ if [ -d "${HIVE_AUX_JARS_PATH}" ]; then
     fi
     HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:$f
   done
-elif [ "${HIVE_AUX_JARS_PATH}" != "" ]; then 
+elif [ "${HIVE_AUX_JARS_PATH}" != "" ]; then
   HIVE_AUX_JARS_PATH=`echo $HIVE_AUX_JARS_PATH | sed 's/,/:/g'`
   HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_AUX_JARS_PATH
 fi

Modified: hive/trunk/hcatalog/bin/hcat.py
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/bin/hcat.py?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/bin/hcat.py (original)
+++ hive/trunk/hcatalog/bin/hcat.py Wed Nov 20 17:44:28 2013
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -15,8 +16,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Resolve our absolute path                                                      
-# resolve links - $0 may be a softlink                                           
+# Resolve our absolute path
+# resolve links - $0 may be a softlink
 
 import os
 import sys
@@ -55,7 +56,7 @@ except ValueError:
 hcatcfg.findHive()
 if 'HIVE_HOME' not in os.environ:
   sys.exit("Hive not found.  Set HIVE_HOME to directory containing Hive.")
-    
+
 if 'HIVE_LIB_DIR' not in os.environ:
   sys.exit("Cannot find lib dir within HIVE_HOME %s" % (os.environ['HIVE_HOME'] + os.path.sep + "lib"))
 
@@ -66,13 +67,13 @@ if 'HIVE_CONF_DIR' not in os.environ:
 # find the hcatalog jar and add it to hadoop classpath
 hcatPrefix = hcatcfg.findHCatPrefix(bindir)
 
-hcatJars = glob.glob(os.path.join(hcatPrefix, 'share', 'hcatalog', 'hcatalog-core-*.jar'))
+hcatJars = glob.glob(os.path.join(hcatPrefix, 'share', 'hcatalog', 'hive-hcatalog-core-*.jar'))
 
 if len(hcatJars) > 1:
   sys.exit("Found more than one hcatalog jar in the prefix path")
 
 if len(hcatJars) < 1:
-  sys.exit("HCatalog jar not found in directory %s" % (os.path.join(hcatPrefix, 'share', 'hcatalog', 'hcatalog-core-*.jar')))
+  sys.exit("HCatalog jar not found in directory %s" % (os.path.join(hcatPrefix, 'share', 'hcatalog', 'hive-hcatalog-core-*.jar')))
 
 if 'HADOOP_CLASSPATH' not in os.environ:
   os.putenv('HADOOP_CLASSPATH', '')
@@ -100,7 +101,7 @@ os.environ['HADOOP_CLASSPATH'] += os.pat
 
 # if the hbase conf dir is present in the environment, add it.
 # there are no checks to see if that path exists
-# FIXME add check - original shell script does not do much if the path 
+# FIXME add check - original shell script does not do much if the path
 # does not exist either
 try:
   if os.environ['HBASE_CONF_DIR'] != "":

Modified: hive/trunk/hcatalog/bin/hcat_server.py
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/bin/hcat_server.py?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/bin/hcat_server.py (original)
+++ hive/trunk/hcatalog/bin/hcat_server.py Wed Nov 20 17:44:28 2013
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -40,7 +41,6 @@ def start_hcat():
       pidWords = line.split()
       for pidStr in pidWords:
         pid = int(pidStr.rstrip('\n'))
-        
     pidFileDesc.close()
   # check if service is already running, if so exit
     os.kill(pid, 0)
@@ -57,7 +57,7 @@ def start_hcat():
   #      n
   #      s/.*<value>\(.*\)<\/value>.*/\1/p
   #      }' $HIVE_SITE_XML`
-  #  HADOOP_OPTS="$HADOOP_OPTS -Dhive.metastore.warehouse.dir=$WAREHOUSE_DIR " 
+  #  HADOOP_OPTS="$HADOOP_OPTS -Dhive.metastore.warehouse.dir=$WAREHOUSE_DIR "
 
   # add in hive-site.xml to classpath
   if 'AUX_CLASSPATH' not in os.environ:
@@ -115,7 +115,7 @@ def start_hcat():
   except Exception as inst:
     print inst
     sys.exit("Metastore startup failed, see %s" % (errFile))
-  
+
   return
 
 def stop_hcat():
@@ -139,7 +139,6 @@ def stop_hcat():
   if kill == True:
     try:
       os.kill(pid, 9)
-      
     except:
       sys.exit("Failed to stop metastore server")
 

Modified: hive/trunk/hcatalog/bin/hcat_server.sh
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/bin/hcat_server.sh?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/bin/hcat_server.sh (original)
+++ hive/trunk/hcatalog/bin/hcat_server.sh Wed Nov 20 17:44:28 2013
@@ -61,7 +61,7 @@ function start_hcat() {
 #      n
 #      s/.*<value>\(.*\)<\/value>.*/\1/p
 #      }' $HIVE_SITE_XML`
-#  HADOOP_OPTS="$HADOOP_OPTS -Dhive.metastore.warehouse.dir=$WAREHOUSE_DIR " 
+#  HADOOP_OPTS="$HADOOP_OPTS -Dhive.metastore.warehouse.dir=$WAREHOUSE_DIR "
 
   # add in hive-site.xml to classpath
   AUX_CLASSPATH=${AUX_CLASSPATH}:`dirname ${HIVE_SITE_XML}`
@@ -100,7 +100,7 @@ function start_hcat() {
   echo Started metastore server init, testing if initialized correctly...
   sleep $SLEEP_TIME_AFTER_START
 
-  if ps -p $PID > /dev/null 
+  if ps -p $PID > /dev/null
   then
     echo $PID > $PID_FILE
     echo "Metastore initialized successfully on port[${METASTORE_PORT}]."

Modified: hive/trunk/hcatalog/bin/hcatcfg.py
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/bin/hcatcfg.py?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/bin/hcatcfg.py (original)
+++ hive/trunk/hcatalog/bin/hcatcfg.py Wed Nov 20 17:44:28 2013
@@ -15,8 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Resolve our absolute path                                                      
-# resolve links - $0 may be a softlink                                           
+# Resolve our absolute path
+# resolve links - $0 may be a softlink
 
 import os.path
 import sys

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh (original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh Wed Nov 20 17:44:28 2013
@@ -42,7 +42,7 @@ ERROR_LOG=${WEBHCAT_LOG_DIR}/webhcat-con
 CONSOLE_LOG=${WEBHCAT_LOG_DIR}/webhcat-console.log
 
 # The name of the webhcat jar file
-WEBHCAT_JAR='webhcat-*.jar'
+WEBHCAT_JAR='hive-webhcat-*.jar'
 
 # How long to wait before testing that the process started correctly
 SLEEP_TIME_AFTER_START=10

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_server.sh
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_server.sh?rev=1543890&r1=1543889&r2=1543890&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_server.sh (original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/bin/webhcat_server.sh Wed Nov 20 17:44:28 2013
@@ -58,7 +58,7 @@ function log() {
 
 # return(print) the webhcat jar
 function find_jar_path() {
-         for dir in "." "build" "share/webhcat/svr/"; do
+         for dir in "." "build" "share/webhcat/svr/lib"; do
                 if (( `ls -1 $base_dir/$dir/$WEBHCAT_JAR 2>/dev/null| wc -l ` > 1 )) ; then
                        echo "Error:  found more than one hcatalog jar in $base_dir/$dir/$WEBHCAT_JAR"
                        exit 1