Repository: kylin Updated Branches: refs/heads/1.x-staging 0917d485c -> 9eaf93544
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-staging Commit: 9eaf935449d304ae58ff58f0ccb51c9d970b236b Parents: 0917d48 Author: lidongsjtu <lid...@apache.org> Authored: Mon Feb 29 20:31:38 2016 +0800 Committer: lidongsjtu <lid...@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"); }