You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/09/03 12:46:02 UTC

[08/50] [abbrv] kylin git commit: minor, retrieve dependency on demand

minor, retrieve dependency on demand


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

Branch: refs/heads/1.5.x-CDH5.7
Commit: 579dfcff33997dc7d74ab33d0913f404413b5dea
Parents: 5a77f5e
Author: lidongsjtu <li...@apache.org>
Authored: Wed Aug 24 16:49:32 2016 +0800
Committer: lidongsjtu <li...@apache.org>
Committed: Wed Aug 24 17:09:32 2016 +0800

----------------------------------------------------------------------
 build/bin/kylin.sh | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/579dfcff/build/bin/kylin.sh
----------------------------------------------------------------------
diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index 365e1fe..695b7f6 100644
--- a/build/bin/kylin.sh
+++ b/build/bin/kylin.sh
@@ -27,18 +27,19 @@ source ${dir}/check-env.sh
 mkdir -p ${KYLIN_HOME}/logs
 mkdir -p ${KYLIN_HOME}/ext
 
-#retrive $hive_dependency and $hbase_dependency
-source ${dir}/find-hive-dependency.sh
-source ${dir}/find-hbase-dependency.sh
+function retrieveDependency() {
+    #retrive $hive_dependency and $hbase_dependency
+    source ${dir}/find-hive-dependency.sh
+    source ${dir}/find-hbase-dependency.sh
+
+    #retrive $KYLIN_EXTRA_START_OPTS
+    if [ -f "${dir}/setenv.sh" ]
+        then source ${dir}/setenv.sh
+    fi
 
-#retrive $KYLIN_EXTRA_START_OPTS
-if [ -f "${dir}/setenv.sh" ]
-    then source ${dir}/setenv.sh
-fi
-
-export HBASE_CLASSPATH_PREFIX=${KYLIN_HOME}/conf:${KYLIN_HOME}/lib/*:${KYLIN_HOME}/tool/*:${KYLIN_HOME}/ext/*:${HBASE_CLASSPATH_PREFIX}
-export HBASE_CLASSPATH=${HBASE_CLASSPATH}:${hive_dependency}
-        
+    export HBASE_CLASSPATH_PREFIX=${KYLIN_HOME}/conf:${KYLIN_HOME}/lib/*:${KYLIN_HOME}/tool/*:${KYLIN_HOME}/ext/*:${HBASE_CLASSPATH_PREFIX}
+    export HBASE_CLASSPATH=${HBASE_CLASSPATH}:${hive_dependency}
+}
 
 # start command
 if [ "$1" == "start" ]
@@ -75,6 +76,8 @@ then
         echo "kylin.security.profile is set to $spring_profile"
     fi
 
+    retrieveDependency
+
     #additionally add tomcat libs to HBASE_CLASSPATH_PREFIX
     export HBASE_CLASSPATH_PREFIX=${tomcat_root}/bin/bootstrap.jar:${tomcat_root}/bin/tomcat-juli.jar:${tomcat_root}/lib/*:${HBASE_CLASSPATH_PREFIX}
 
@@ -143,7 +146,7 @@ then
     fi
     if [ "$2" == "start" ]
     then
-      
+        retrieveDependency
         source ${dir}/find-kafka-dependency.sh
         
         # KYLIN_EXTRA_START_OPTS is for customized settings, checkout bin/setenv.sh
@@ -182,6 +185,7 @@ elif [ "$1" == "monitor" ]
 then
     echo "monitor job"
 
+    retrieveDependency
     source ${dir}/find-kafka-dependency.sh
     
     # KYLIN_EXTRA_START_OPTS is for customized settings, checkout bin/setenv.sh
@@ -206,6 +210,7 @@ then
 # tool command
 elif [[ "$1" = org.apache.kylin.* ]]
 then
+    retrieveDependency
 
     #retrive $KYLIN_EXTRA_START_OPTS from a separate file called setenv-tool.sh
     reset KYLIN_EXTRA_START_OPTS # reset the global server setenv config first