Index: conf/hive-env.sh.template =================================================================== --- conf/hive-env.sh.template (revision 0) +++ conf/hive-env.sh.template (revision 0) @@ -0,0 +1,34 @@ +# Set Hive and Hadoop environment variables here. These variables can be used +# to control the execution of Hive. It should be used by admins to configure +# the Hive installation (so that users do not have to set environment variables +# or set command line parameters to get correct behavior). +# +# The hive service being invoked (CLI/HWI etc.) is available via the environment +# variable SERVICE + + +# Hive Client memory usage can be an issue if a large number of clients +# are running at the same time. The flags below have been useful in +# reducing memory usage: +# +# if [ "$SERVICE" = "cli" ]; then +# export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=12 -Xms10m -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:+UseParNewGC -XX:-UseGCOverheadLimit" +# fi + +# The heap size of the jvm stared by hive shell script can be controlled via: +# +# export HADOOP_HEAPSIZE=1024 +# +# Larger heap size may be required when running queries over large number of files or partitions. +# By default hive shell scripts use a heap size of 256 (MB). Larger heap size would also be +# appropriate for hive server (hwi etc). + + +# Set HADOOP_HOME to point to a specific hadoop install directory +# HADOOP_HOME=${bin}/../../hadoop + +# Hive Configuration Directory can be controlled by: +# export HIVE_CONF_DIR= + +# Folder containing extra ibraries required for hive compilation/execution can be controlled by: +# export HIVE_AUX_JARS_PATH= Index: build.xml =================================================================== --- build.xml (revision 983178) +++ build.xml (working copy) @@ -256,7 +256,10 @@ - + + + + Index: bin/ext/util/execHiveCmd.sh =================================================================== --- bin/ext/util/execHiveCmd.sh (revision 983178) +++ bin/ext/util/execHiveCmd.sh (working copy) @@ -29,10 +29,6 @@ exit 6 fi - # increase the threashold for large queries - HADOOP_HEAPSIZE=4096 - HADOOP_OPTS="$HADOOP_OPTS -XX:-UseGCOverheadLimit" - if [ $minor_ver -lt 20 ]; then exec $HADOOP jar $AUX_JARS_CMD_LINE ${HIVE_LIB}/hive-cli-*.jar $CLASS $HIVE_OPTS "$@" else Index: bin/hive =================================================================== --- bin/hive (revision 983178) +++ bin/hive (working copy) @@ -25,6 +25,41 @@ . "$bin"/hive-config.sh +SERVICE="" +HELP="" +while [ $# -gt 0 ]; do + case "$1" in + --service) + shift + SERVICE=$1 + shift + ;; + --rcfilecat) + SERVICE=rcfilecat + shift + ;; + --help) + HELP=_help + shift + ;; + *) + break + ;; + esac +done + +if [ "$SERVICE" = "" ] ; then + if [ "$HELP" = "_help" ] ; then + SERVICE="help" + else + SERVICE="cli" + fi +fi + +if [ -f "${HIVE_CONF_DIR}/hive-env.sh" ]; then + . "${HIVE_CONF_DIR}/hive-env.sh" +fi + CLASSPATH="${HIVE_CONF_DIR}" HIVE_LIB=${HIVE_HOME}/lib @@ -135,37 +170,6 @@ . $i done -SERVICE="" -HELP="" -while [ $# -gt 0 ]; do - case "$1" in - --service) - shift - SERVICE=$1 - shift - ;; - --rcfilecat) - SERVICE=rcfilecat - shift - ;; - --help) - HELP=_help - shift - ;; - *) - break - ;; - esac -done - -if [ "$SERVICE" = "" ] ; then - if [ "$HELP" = "_help" ] ; then - SERVICE="help" - else - SERVICE="cli" - fi -fi - TORUN="" for j in $SERVICE_LIST ; do if [ "$j" = "$SERVICE" ] ; then