kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject kylin git commit: KYLIN-2578 fix ITDistributedSchedulerBaseTest
Date Sun, 07 May 2017 12:36:46 GMT
Repository: kylin
Updated Branches:
  refs/heads/master 263a1e888 -> 41c7a4d94


KYLIN-2578 fix ITDistributedSchedulerBaseTest


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

Branch: refs/heads/master
Commit: 41c7a4d9417eb75dad5f0da4e5a07a14e8f7e056
Parents: 263a1e8
Author: Yang Li <liyang@apache.org>
Authored: Sun May 7 20:36:24 2017 +0800
Committer: Yang Li <liyang@apache.org>
Committed: Sun May 7 20:36:24 2017 +0800

----------------------------------------------------------------------
 .../kylin/job/impl/threadpool/DistributedScheduler.java |  4 ++--
 .../apache/kylin/job/BaseTestDistributedScheduler.java  | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/41c7a4d9/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DistributedScheduler.java
----------------------------------------------------------------------
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 0714d90..6d12b8b 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
@@ -304,11 +304,11 @@ public class DistributedScheduler implements Scheduler<AbstractExecutable>,
Conn
         }
     }
 
-    public String getLockPath(String pathName) {
+    public static String getLockPath(String pathName) {
         return ZOOKEEPER_LOCK_PATH + "/" + pathName;
     }
 
-    private String getWatchPath() {
+    private static String getWatchPath() {
         return ZOOKEEPER_LOCK_PATH;
     }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/41c7a4d9/kylin-it/src/test/java/org/apache/kylin/job/BaseTestDistributedScheduler.java
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/java/org/apache/kylin/job/BaseTestDistributedScheduler.java
b/kylin-it/src/test/java/org/apache/kylin/job/BaseTestDistributedScheduler.java
index 3576d18..48ef923 100644
--- a/kylin-it/src/test/java/org/apache/kylin/job/BaseTestDistributedScheduler.java
+++ b/kylin-it/src/test/java/org/apache/kylin/job/BaseTestDistributedScheduler.java
@@ -163,8 +163,8 @@ public class BaseTestDistributedScheduler extends HBaseMetadataTestCase
{
         }
     }
 
-    boolean lock(ZookeeperDistributedLock jobLock, String cubeName) {
-        return jobLock.lock(getLockPath(cubeName));
+    boolean lock(ZookeeperDistributedLock jobLock, String segName) {
+        return jobLock.lock(DistributedScheduler.getLockPath(segName));
     }
 
     private static void initZk() {
@@ -177,8 +177,8 @@ public class BaseTestDistributedScheduler extends HBaseMetadataTestCase
{
         zkClient.start();
     }
 
-    String getServerName(String cubeName) {
-        String lockPath = getLockPath(cubeName);
+    String getServerName(String segName) {
+        String lockPath = getFullLockPath(segName);
         String serverName = null;
         if (zkClient.getState().equals(CuratorFrameworkState.STARTED)) {
             try {
@@ -193,7 +193,7 @@ public class BaseTestDistributedScheduler extends HBaseMetadataTestCase
{
         return serverName;
     }
 
-    private String getLockPath(String pathName) {
-        return DistributedScheduler.ZOOKEEPER_LOCK_PATH + "/" + kylinConfig1.getMetadataUrlPrefix()
+ "/" + pathName;
+    private String getFullLockPath(String segName) {
+        return "/kylin/" + kylinConfig1.getMetadataUrlPrefix() + DistributedScheduler.getLockPath(segName);
     }
 }


Mime
View raw message