kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject [18/43] kylin git commit: KYLIN-1998 release job engine lock at shutdown
Date Sun, 11 Sep 2016 06:06:14 GMT
KYLIN-1998 release job engine lock at shutdown


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

Branch: refs/heads/v1.5.4-release2
Commit: 97778788a0fea2bb4db4254264d42c58bdb8f7cc
Parents: 413bc9f
Author: Li Yang <liyang@apache.org>
Authored: Wed Sep 7 17:37:57 2016 +0800
Committer: Li Yang <liyang@apache.org>
Committed: Wed Sep 7 17:38:15 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/job/impl/threadpool/DefaultScheduler.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/97778788/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
----------------------------------------------------------------------
diff --git a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
index 2dc1ab5..1ea3be0 100644
--- a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
+++ b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
@@ -49,6 +49,7 @@ import com.google.common.collect.Maps;
  */
 public class DefaultScheduler implements Scheduler<AbstractExecutable>, ConnectionStateListener
{
 
+    private JobLock jobLock;
     private ExecutableManager executableManager;
     private FetcherRunner fetcher;
     private ScheduledExecutorService fetcherPool;
@@ -181,6 +182,8 @@ public class DefaultScheduler implements Scheduler<AbstractExecutable>,
Connecti
 
     @Override
     public synchronized void init(JobEngineConfig jobEngineConfig, final JobLock jobLock)
throws SchedulerException {
+        this.jobLock = jobLock;
+        
         String serverMode = jobEngineConfig.getConfig().getServerMode();
         if (!("job".equals(serverMode.toLowerCase()) || "all".equals(serverMode.toLowerCase())))
{
             logger.info("server mode: " + serverMode + ", no need to run job scheduler");
@@ -216,6 +219,8 @@ public class DefaultScheduler implements Scheduler<AbstractExecutable>,
Connecti
 
     @Override
     public void shutdown() throws SchedulerException {
+        logger.info("Shutingdown Job Engine ....");
+        jobLock.unlock();
         fetcherPool.shutdown();
         jobPool.shutdown();
     }


Mime
View raw message