You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by GitBox <gi...@apache.org> on 2018/02/13 06:07:33 UTC

[GitHub] yiming187 closed pull request #64: JIRA_ID:KYLIN-2819

yiming187 closed pull request #64: JIRA_ID:KYLIN-2819
URL: https://github.com/apache/kylin/pull/64
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
index 0e990df52f..0a62f3d31f 100644
--- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
+++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
@@ -226,6 +226,10 @@ public String getHdfsWorkingDirectory() {
         return cachedHdfsWorkingDirectory;
     }
 
+    public String getZkBasePath() {
+        return getOptional("kylin.zk.base.path", "/kylin");
+    }
+
     /**
      * A comma separated list of host:port pairs, each corresponding to a ZooKeeper server
      */
diff --git a/core-common/src/main/resources/kylin-defaults.properties b/core-common/src/main/resources/kylin-defaults.properties
index 7c421f9fa0..0cd9b9c248 100644
--- a/core-common/src/main/resources/kylin-defaults.properties
+++ b/core-common/src/main/resources/kylin-defaults.properties
@@ -26,6 +26,8 @@ kylin.env.hdfs-working-dir=/kylin
 # DEV|QA|PROD. DEV will turn on some dev features, QA and PROD has no difference in terms of functions.
 kylin.env=QA
 
+# kylin zk base path
+kylin.zk.base.path=/kylin
 
 ### SERVER | WEB ###
 
diff --git a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DistributedScheduler.java b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DistributedScheduler.java
index e3a5836b97..9902618143 100644
--- a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DistributedScheduler.java
+++ b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DistributedScheduler.java
@@ -82,7 +82,7 @@
     private String serverName;
 
     private final static String SEGMENT_ID = "segmentId";
-    public static final String ZOOKEEPER_LOCK_PATH = "/job_engine/lock"; // note ZookeeperDistributedLock will ensure zk path prefix: /kylin/metadata
+    public static final String ZOOKEEPER_LOCK_PATH = "/job_engine/lock"; // note ZookeeperDistributedLock will ensure zk path prefix: /${kylin.zk.base.path}/metadata
 
     //only for it test
     public static DistributedScheduler getInstance(KylinConfig config) {
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLock.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLock.java
index 63ffda0a25..27278ffdee 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLock.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ZookeeperDistributedLock.java
@@ -102,7 +102,7 @@ public Factory() {
 
         public Factory(KylinConfig config) {
             this.curator = getZKClient(config);
-            this.zkPathBase = fixSlash("/kylin/" + KylinConfig.getInstanceFromEnv().getMetadataUrlPrefix());
+            this.zkPathBase = fixSlash(config.getZkBasePath() + KylinConfig.getInstanceFromEnv().getMetadataUrlPrefix());
         }
 
         @Override


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services