hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [24/27] hive git commit: HIVE-12497: Remove HADOOP_CLIENT_OPTS from hive script (Prasanth Jayachandran reviewed by Gopal V)
Date Mon, 30 Nov 2015 19:15:35 GMT
HIVE-12497: Remove HADOOP_CLIENT_OPTS from hive script (Prasanth Jayachandran reviewed by Gopal
V)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/e325eac9
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e325eac9
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e325eac9

Branch: refs/heads/master-fixed
Commit: e325eac9f6eeb8dfef5d55c4ec1b526af8cd98a6
Parents: eb1b80d
Author: Prasanth Jayachandran <j.prasanth.j@gmail.com>
Authored: Sun Nov 29 16:53:20 2015 -0600
Committer: Owen O'Malley <omalley@apache.org>
Committed: Mon Nov 30 11:14:38 2015 -0800

----------------------------------------------------------------------
 bin/ext/version.sh |  2 +-
 bin/hive           | 23 ++++++++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/e325eac9/bin/ext/version.sh
----------------------------------------------------------------------
diff --git a/bin/ext/version.sh b/bin/ext/version.sh
index bb6449d..b6a237b 100644
--- a/bin/ext/version.sh
+++ b/bin/ext/version.sh
@@ -27,7 +27,7 @@ version () {
 
   # hadoop 20 or newer - skip the aux_jars option and hiveconf
   CLASS=org.apache.hive.common.util.HiveVersionInfo
-  exec $HADOOP jar $JAR $CLASS
+  exec $HADOOP jar $JAR $CLASS 2>> ${STDERR}
 }
 
 version_help () {

http://git-wip-us.apache.org/repos/asf/hive/blob/e325eac9/bin/hive
----------------------------------------------------------------------
diff --git a/bin/hive b/bin/hive
index 47d99f7..4818667 100755
--- a/bin/hive
+++ b/bin/hive
@@ -25,6 +25,8 @@ bin=`cd "$bin"; pwd`
 
 . "$bin"/hive-config.sh
 
+TMP_USER_DIR="/tmp/${USER}"
+STDERR="${TMP_USER_DIR}/stderr"
 SERVICE=""
 HELP=""
 while [ $# -gt 0 ]; do
@@ -193,18 +195,29 @@ if [ "$HADOOP_HOME" == "" ]; then
   exit 4;
 fi
 
-# to avoid errors from log4j2 automatic configuration loading
-export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.xml
"
-
 HADOOP=$HADOOP_HOME/bin/hadoop
 if [ ! -f ${HADOOP} ]; then
   echo "Cannot find hadoop installation: \$HADOOP_HOME or \$HADOOP_PREFIX must be set or
hadoop must be in the path";
   exit 4;
 fi
 
+if [ ! -d ${TMP_USER_DIR} ]; then
+  mkdir -p ${TMP_USER_DIR} 2> /dev/null
+  if [ $? -ne 0 ]; then
+    STDERR="/dev/tty"
+  fi
+fi
+
+if [ "${STDERR}" != "/dev/null" ] && [ ! -f ${STDERR} ]; then
+  touch ${STDERR} 2> /dev/null
+  if [ $? -ne 0 ]; then
+    STDERR="/dev/tty"
+  fi
+fi
+
 # Make sure we're using a compatible version of Hadoop
 if [ "x$HADOOP_VERSION" == "x" ]; then
-    HADOOP_VERSION=$($HADOOP version | awk -F"\t" '/Hadoop/ {print $0}' | cut -d' ' -f 2);
+    HADOOP_VERSION=$($HADOOP version 2>> ${STDERR} | awk -F"\t" '/Hadoop/ {print $0}'
| cut -d' ' -f 2);
 fi
 
 # Save the regex to a var to workaround quoting incompatabilities
@@ -253,7 +266,7 @@ HBASE_BIN=${HBASE_BIN:-"$(which hbase)"}
 if [[ -n $HBASE_BIN ]] ; then
   # exclude ZK, PB, and Guava (See HIVE-2055)
   # depends on HBASE-8438 (hbase-0.94.14+, hbase-0.96.1+) for `hbase mapredcp` command
-  for x in $($HBASE_BIN mapredcp | tr ':' '\n') ; do
+  for x in $($HBASE_BIN mapredcp 2>> ${STDERR} | tr ':' '\n') ; do
     if [[ $x == *zookeeper* || $x == *protobuf-java* || $x == *guava* ]] ; then
       continue
     fi


Mime
View raw message