You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2008/12/18 02:58:22 UTC

svn commit: r727617 - in /hadoop/hive/trunk: CHANGES.txt bin/hive build.xml

Author: zshao
Date: Wed Dec 17 17:58:22 2008
New Revision: 727617

URL: http://svn.apache.org/viewvc?rev=727617&view=rev
Log:
HIVE-107. Case structure for bin/hive. (Edward Capriolo via zshao)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/bin/hive
    hadoop/hive/trunk/build.xml

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=727617&r1=727616&r2=727617&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Dec 17 17:58:22 2008
@@ -26,6 +26,8 @@
 
   IMPROVEMENTS
 
+    HIVE-107. Case structure for bin/hive. (Edward Capriolo via zshao)
+
     HIVE-101. Set svn:ignore for the root. (Johan Oskarsson via zshao)
 
     HIVE-170. Map-side aggregations to estimate memory size. (Namit via zshao)

Modified: hadoop/hive/trunk/bin/hive
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/bin/hive?rev=727617&r1=727616&r2=727617&view=diff
==============================================================================
--- hadoop/hive/trunk/bin/hive (original)
+++ hadoop/hive/trunk/bin/hive Wed Dec 17 17:58:22 2008
@@ -100,29 +100,55 @@
   exit 4;
 fi
 
-if [ "$1" == "service" ]; then
-  shift
-  CLASS=org.apache.hadoop.hive.service.HiveServer
-  JAR=${HIVE_LIB}/hive_service.jar
-  if [ "$HIVE_PORT" != "" ]; then
-    HIVE_OPTS=$HIVE_PORT
+if [ "${AUX_PARAM}" != "" ]; then
+  HIVE_OPTS="$HIVE_OPTS -hiveconf hive.aux.jars.path=${AUX_PARAM}"
+  AUX_JARS_CMD_LINE="-libjars ${AUX_PARAM}"
+fi
+
+SERVICE_LIST=""
+
+for i in "$bin"/ext/*.sh ; do
+  . $i
+done
+
+SERVICE=""
+HELP=""
+while [ $# -gt 0 ]; do
+  case "$1" in
+    --service)
+      shift
+      SERVICE=$1
+      shift
+      ;;
+    --help)
+      HELP=_help
+      shift
+      ;;
+    *)
+      break
+      ;;
+  esac
+done
+
+if [ "$SERVICE" = "" ] ; then
+  if [ "$HELP" = "_help" ] ; then
+    SERVICE="help"
+  else
+    SERVICE="cli"
   fi
-else
-  CLASS=org.apache.hadoop.hive.cli.CliDriver
-  JAR=${HIVE_LIB}/hive_cli.jar
-  # override default value of hadoop.bin.path to point to what we are running off
-  # if the user specified a -D override - this will be further overriden
-  export HIVE_OPTS="-hiveconf hadoop.bin.path=$HADOOP"
 fi
 
+TORUN=""
+for j in $SERVICE_LIST ; do
+  if [ "$j" = "$SERVICE" ] ; then
+    TORUN=${j}$HELP
+  fi
+done
 
-if [ "${AUX_PARAM}" != "" ]; then
-  HIVE_OPTS="$HIVE_OPTS -hiveconf hive.aux.jars.path=${AUX_PARAM}"
-  AUX_JARS_CMD_LINE="-libjars ${AUX_PARAM}"
+if [ "$TORUN" = "" ] ; then
+  echo "Service $SERVICE not found"
+  echo "Available Services: $SERVICE_LIST"
+  exit 5
+else
+  $TORUN "$@"
 fi
-#echo "CLASSPATH="$CLASSPATH
-#echo "AUX_LIB_PATH"=$AUX_PARAM
-#echo "HADOOP_OPTS="$HADOOP_OPTS
-# note: $@ only works in "$@"
-#echo $HADOOP jar $AUX_JARS_CMD_LINE $JAR $CLASS $HIVE_OPTS "$@"
-exec $HADOOP jar $AUX_JARS_CMD_LINE $JAR $CLASS $HIVE_OPTS "$@"

Modified: hadoop/hive/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/build.xml?rev=727617&r1=727616&r2=727617&view=diff
==============================================================================
--- hadoop/hive/trunk/build.xml (original)
+++ hadoop/hive/trunk/build.xml Wed Dec 17 17:58:22 2008
@@ -147,6 +147,9 @@
     <exec executable="cp" failonerror="true">
       <arg line="-p '${hive.root}/bin/hive' '${target.bin.dir}'"/>
     </exec>
+    <exec executable="cp" failonerror="true">
+      <arg line="-r '${hive.root}/bin/ext' '${target.bin.dir}'" />
+    </exec>
     <copy file="${hive.root}/bin/hive-config.sh" todir="${target.bin.dir}"/>
     <copy file="${basedir}/conf/hive-default.xml" todir="${target.conf.dir}"/>
     <copy file="${basedir}/conf/hive-log4j.properties" todir="${target.conf.dir}"/>