Index: conf/hive-env.sh.template =================================================================== --- conf/hive-env.sh.template (revision 0) +++ conf/hive-env.sh.template (revision 0) @@ -0,0 +1,22 @@ +# Set Hive and Hadoop environment variables here. +# +# +# 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" +# fi + +# Hadoop Heap Size can be overriden here. Larger heap size may be required when +# running queries over large number of files or partitions +# +# export HADOOP_HEAPSIZE=1024 + +# Set HADOOP_HOME to point to a specific hadoop install directory +# HADOOP_HOME=${bin}/../../hadoop Index: bin/hive =================================================================== --- bin/hive (revision 982894) +++ 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