kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject [21/29] kylin git commit: minor, fix issue that some job scheduler tests always fail in mvn test -fae
Date Wed, 02 Mar 2016 05:42:11 GMT
minor, fix issue that some job scheduler tests always fail in mvn test -fae


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

Branch: refs/heads/1.x-HBase1.1.3
Commit: 9eaf935449d304ae58ff58f0ccb51c9d970b236b
Parents: 0917d48
Author: lidongsjtu <lidong@apache.org>
Authored: Mon Feb 29 20:31:38 2016 +0800
Committer: lidongsjtu <lidong@apache.org>
Committed: Mon Feb 29 20:31:38 2016 +0800

----------------------------------------------------------------------
 .../job/impl/threadpool/BaseSchedulerTest.java  | 22 +++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/9eaf9354/job/src/test/java/org/apache/kylin/job/impl/threadpool/BaseSchedulerTest.java
----------------------------------------------------------------------
diff --git a/job/src/test/java/org/apache/kylin/job/impl/threadpool/BaseSchedulerTest.java
b/job/src/test/java/org/apache/kylin/job/impl/threadpool/BaseSchedulerTest.java
index f3f4272..cb9535d 100644
--- a/job/src/test/java/org/apache/kylin/job/impl/threadpool/BaseSchedulerTest.java
+++ b/job/src/test/java/org/apache/kylin/job/impl/threadpool/BaseSchedulerTest.java
@@ -22,8 +22,8 @@ import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 
 import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.common.lock.ZookeeperJobLock;
-import org.apache.kylin.common.util.HBaseMetadataTestCase;
+import org.apache.kylin.common.lock.JobLock;
+import org.apache.kylin.common.util.LocalFileMetadataTestCase;
 import org.apache.kylin.job.constant.ExecutableConstants;
 import org.apache.kylin.job.engine.JobEngineConfig;
 import org.apache.kylin.job.execution.AbstractExecutable;
@@ -32,10 +32,7 @@ import org.apache.kylin.job.manager.ExecutableManager;
 import org.junit.After;
 import org.junit.Before;
 
-/**
- * Created by qianzhou on 12/26/14.
- */
-public abstract class BaseSchedulerTest extends HBaseMetadataTestCase {
+public abstract class BaseSchedulerTest extends LocalFileMetadataTestCase {
 
     private DefaultScheduler scheduler;
 
@@ -88,7 +85,18 @@ public abstract class BaseSchedulerTest extends HBaseMetadataTestCase {
         setFinalStatic(ExecutableConstants.class.getField("DEFAULT_SCHEDULER_INTERVAL_SECONDS"),
10);
         jobService = ExecutableManager.getInstance(KylinConfig.getInstanceFromEnv());
         scheduler = DefaultScheduler.getInstance();
-        scheduler.init(new JobEngineConfig(KylinConfig.getInstanceFromEnv()), new ZookeeperJobLock());
+        scheduler.init(new JobEngineConfig(KylinConfig.getInstanceFromEnv()), new JobLock()
{
+            @Override
+            public boolean lock() {
+                return true;
+            }
+
+            @Override
+            public void unlock() {
+                return;
+            }
+        });
+
         if (!scheduler.hasStarted()) {
             throw new RuntimeException("scheduler has not been started");
         }


Mime
View raw message