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 2015/07/05 01:30:29 UTC

incubator-kylin git commit: minor, fix bug in DefaultScheduler, didn't check job lock

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.8 8aa40074a -> 0470d0a1d


minor, fix bug in DefaultScheduler, didn't check job lock


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

Branch: refs/heads/0.8
Commit: 0470d0a1dc3a4c52ee6922495005ef51484dd8d2
Parents: 8aa4007
Author: Yang Li <li...@apache.org>
Authored: Sun Jul 5 07:30:18 2015 +0800
Committer: Yang Li <li...@apache.org>
Committed: Sun Jul 5 07:30:18 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/job/impl/threadpool/DefaultScheduler.java   | 4 +++-
 server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/0470d0a1/job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
----------------------------------------------------------------------
diff --git a/job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java b/job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
index c7eaf34..6c93da6 100644
--- a/job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
+++ b/job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
@@ -150,7 +150,9 @@ public class DefaultScheduler implements Scheduler<AbstractExecutable>, Connecti
 
         this.jobEngineConfig = jobEngineConfig;
 
-        jobLock.lock();
+        if (jobLock.lock() == false) {
+            throw new IllegalStateException("Cannot start job scheduler due to lack of job lock");
+        }
 
         executableManager = ExecutableManager.getInstance(jobEngineConfig.getConfig());
         //load all executable, set them to a consistent status

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/0470d0a1/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java b/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java
index 7476e47..08f5217 100644
--- a/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java
+++ b/server/src/test/java/org/apache/kylin/jdbc/ITJDBCDriverTest.java
@@ -43,7 +43,7 @@ public class ITJDBCDriverTest extends HBaseMetadataTestCase {
     @BeforeClass
     public static void beforeClass() throws Exception {
         sysPropsOverride.override("spring.profiles.active", "testing");
-        //sysPropsOverride.override("catalina.home", "."); // resources/log4j.properties ref ${catalina.home}
+        sysPropsOverride.override("catalina.home", "."); // resources/log4j.properties ref ${catalina.home}
         staticCreateTestMetadata();
         startJetty();
     }