trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/2] incubator-trafodion git commit: [TRAFODION-2806] optimize 'hbase classpath' cmd in sqenvcom.sh
Date Thu, 16 Nov 2017 23:48:48 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master c5519b495 -> 7694a63ed


[TRAFODION-2806] optimize 'hbase classpath' cmd in sqenvcom.sh


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/2d9aaa23
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/2d9aaa23
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/2d9aaa23

Branch: refs/heads/master
Commit: 2d9aaa2302f4f747d6095a3c33fb452920500ea8
Parents: e4ef5e3
Author: Eason <hfutmkby@gmail.com>
Authored: Wed Nov 15 10:29:58 2017 +0800
Committer: Eason <hfutmkby@gmail.com>
Committed: Wed Nov 15 10:29:58 2017 +0800

----------------------------------------------------------------------
 core/sqf/sqenvcom.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2d9aaa23/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index bb1638e..8063225 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -286,6 +286,17 @@ else
   export LOC_JVMLIBS=$JAVA_HOME/jre/lib/i386/server
 fi
 
+# cache hbase classpath to a file to avoid running hbase command
+# every time when login as trafodion
+CACHED_HBASE_CP_FILE="$TRAF_VAR/hbase_classpath"
+if [[ ! -f $CACHED_HBASE_CP_FILE ]]; then
+  #hbase classpath captures all the right set of jars hbase is using.
+  #this also includes the trx jar that gets installed as part of install.
+  #Additional testing needed.Including it here for future validation.
+  hbase classpath > $CACHED_HBASE_CP_FILE 2>/dev/null
+fi
+lv_hbase_cp=`cat $CACHED_HBASE_CP_FILE`
+
 if [[ -e $TRAF_HOME/sql/scripts/sw_env.sh ]]; then
   # we are on a development system where install_local_hadoop has been
   # executed
@@ -337,8 +348,6 @@ elif [[ -d /opt/cloudera/parcels/CDH ]]; then
   export CURL_INC_DIR=/usr/include
   export CURL_LIB_DIR=/usr/lib64
 
-  lv_hbase_cp=`/opt/cloudera/parcels/CDH/bin/hbase classpath`
-
   # directories with jar files and list of jar files
   # (could try to reduce the number of jars in the classpath)
   export HADOOP_JAR_DIRS="/opt/cloudera/parcels/CDH/lib/hadoop
@@ -369,8 +378,6 @@ elif [[ -n "$(ls /usr/lib/hadoop/hadoop-*cdh*.jar 2>/dev/null)" ]];
then
   export CURL_INC_DIR=/usr/include
   export CURL_LIB_DIR=/usr/lib64
 
-  lv_hbase_cp=`hbase classpath`
-
   # directories with jar files and list of jar files
   # (could try to reduce the number of jars in the classpath)
   export HADOOP_JAR_DIRS="/usr/lib/hadoop
@@ -402,8 +409,6 @@ elif [[ -n "$(ls /etc/init.d/ambari* 2>/dev/null)" ]]; then
   export CURL_INC_DIR=/usr/include
   export CURL_LIB_DIR=/usr/lib64
 
-  lv_hbase_cp=`hbase classpath`
-
   # directories with jar files and list of jar files
   export HADOOP_JAR_DIRS="/usr/hdp/current/hadoop-client
                           /usr/hdp/current/hadoop-client/lib
@@ -573,11 +578,6 @@ EOF
     export HADOOP_JAR_FILES=
     export HIVE_JAR_DIRS="$APACHE_HIVE_HOME/lib"
 
-    #hbase classpath captures all the right set of jars hbase is using.
-    #this also includes the trx jar that gets installed as part of install.
-    #Additional testing needed.Including it here for future validation.
-    lv_hbase_cp=`hbase classpath`
-
     # end of code for Apache Hadoop/HBase installation w/o distro
     export HBASE_TRX_JAR=${HBASE_TRX_ID_APACHE}-${TRAFODION_VER}.jar
     export DTM_COMMON_JAR=trafodion-dtm-apache-${TRAFODION_VER}.jar


Mime
View raw message