当前位置: 首页>>代码示例>>Java>>正文


Java BaseTestExecutable类代码示例

本文整理汇总了Java中org.apache.kylin.job.BaseTestExecutable的典型用法代码示例。如果您正苦于以下问题:Java BaseTestExecutable类的具体用法?Java BaseTestExecutable怎么用?Java BaseTestExecutable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BaseTestExecutable类属于org.apache.kylin.job包,在下文中一共展示了BaseTestExecutable类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testIllegalState

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testIllegalState() throws Exception {
    logger.info("testIllegalState");
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    BaseTestExecutable task2 = new RunningTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    execMgr.addJob(job);
    ExecutableManager.getInstance(KylinConfig.getInstanceFromEnv()).updateJobOutput(task2.getId(),
            ExecutableState.RUNNING, null, null);
    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(job.getId()).getState());
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task1.getId()).getState());
    Assert.assertEquals(ExecutableState.RUNNING, execMgr.getOutput(task2.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:17,代码来源:DefaultSchedulerTest.java

示例2: testSchedulerStop

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSchedulerStop() throws Exception {
    logger.info("testSchedulerStop");

    thrown.expect(RuntimeException.class);
    thrown.expectMessage("too long wait time");

    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new FiveSecondSucceedTestExecutable();
    job.addTask(task1);
    execMgr.addJob(job);

    //sleep 3s to make sure SucceedTestExecutable is running 
    Thread.sleep(3000);
    //scheduler failed due to some reason
    scheduler.shutdown();

    waitForJobFinish(job.getId(), 6000);
}
 
开发者ID:apache,项目名称:kylin,代码行数:20,代码来源:DefaultSchedulerTest.java

示例3: testSchedulerRestart

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSchedulerRestart() throws Exception {
    logger.info("testSchedulerRestart");

    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new FiveSecondSucceedTestExecutable();
    job.addTask(task1);
    execMgr.addJob(job);

    //sleep 3s to make sure SucceedTestExecutable is running 
    Thread.sleep(3000);
    //scheduler failed due to some reason
    scheduler.shutdown();
    //restart
    startScheduler();

    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(job.getId()).getState());
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task1.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:21,代码来源:DefaultSchedulerTest.java

示例4: test

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void test() throws Exception {
    assertNotNull(service);
    BaseTestExecutable executable = new SucceedTestExecutable();
    executable.setParam("test1", "test1");
    executable.setParam("test2", "test2");
    executable.setParam("test3", "test3");
    service.addJob(executable);
    List<AbstractExecutable> result = service.getAllExecutables();
    assertEquals(1, result.size());
    AbstractExecutable another = service.getJob(executable.getId());
    assertJobEqual(executable, another);

    service.updateJobOutput(executable.getId(), ExecutableState.RUNNING, null, "test output");
    assertJobEqual(executable, service.getJob(executable.getId()));
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:17,代码来源:ExecutableManagerTest.java

示例5: testSingleTaskJob

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSingleTaskJob() throws Exception {
    logger.info("testSingleTaskJob");
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    job.addTask(task1);
    execMgr.addJob(job);
    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(job.getId()).getState());
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task1.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:12,代码来源:DefaultSchedulerTest.java

示例6: testSucceed

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSucceed() throws Exception {
    logger.info("testSucceed");
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    BaseTestExecutable task2 = new SucceedTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    execMgr.addJob(job);
    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(job.getId()).getState());
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task1.getId()).getState());
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task2.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:DefaultSchedulerTest.java

示例7: testSucceedAndFailed

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSucceedAndFailed() throws Exception {
    logger.info("testSucceedAndFailed");
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    BaseTestExecutable task2 = new FailedTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    execMgr.addJob(job);
    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(job.getId()).getState());
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task1.getId()).getState());
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(task2.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:DefaultSchedulerTest.java

示例8: testSucceedAndError

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSucceedAndError() throws Exception {
    logger.info("testSucceedAndError");
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new ErrorTestExecutable();
    BaseTestExecutable task2 = new SucceedTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    execMgr.addJob(job);
    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(job.getId()).getState());
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(task1.getId()).getState());
    Assert.assertEquals(ExecutableState.READY, execMgr.getOutput(task2.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:DefaultSchedulerTest.java

示例9: testRetryableException

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
public void testRetryableException() throws Exception {
    System.setProperty("kylin.job.retry-exception-classes", "java.io.FileNotFoundException");
    System.setProperty("kylin.job.retry", "3");
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    BaseTestExecutable task2 = new RetryableTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    execMgr.addJob(job);
    waitForJobFinish(job.getId(), 10000);
    Assert.assertEquals(ExecutableState.SUCCEED, execMgr.getOutput(task1.getId()).getState());
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(task2.getId()).getState());
    Assert.assertEquals(ExecutableState.ERROR, execMgr.getOutput(job.getId()).getState());
}
 
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:DefaultSchedulerTest.java

示例10: testSingleTaskJob

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSingleTaskJob() throws Exception {
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    job.addTask(task1);
    jobService.addJob(job);
    waitForJobFinish(job.getId());
    assertEquals(ExecutableState.SUCCEED, jobService.getOutput(job.getId()).getState());
    assertEquals(ExecutableState.SUCCEED, jobService.getOutput(task1.getId()).getState());
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:DefaultSchedulerTest.java

示例11: testSucceed

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSucceed() throws Exception {
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    BaseTestExecutable task2 = new SucceedTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    jobService.addJob(job);
    waitForJobFinish(job.getId());
    assertEquals(ExecutableState.SUCCEED, jobService.getOutput(job.getId()).getState());
    assertEquals(ExecutableState.SUCCEED, jobService.getOutput(task1.getId()).getState());
    assertEquals(ExecutableState.SUCCEED, jobService.getOutput(task2.getId()).getState());
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:14,代码来源:DefaultSchedulerTest.java

示例12: testSucceedAndFailed

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSucceedAndFailed() throws Exception {
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SucceedTestExecutable();
    BaseTestExecutable task2 = new FailedTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    jobService.addJob(job);
    waitForJobFinish(job.getId());
    assertEquals(ExecutableState.ERROR, jobService.getOutput(job.getId()).getState());
    assertEquals(ExecutableState.SUCCEED, jobService.getOutput(task1.getId()).getState());
    assertEquals(ExecutableState.ERROR, jobService.getOutput(task2.getId()).getState());
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:14,代码来源:DefaultSchedulerTest.java

示例13: testSucceedAndError

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testSucceedAndError() throws Exception {
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new ErrorTestExecutable();
    BaseTestExecutable task2 = new SucceedTestExecutable();
    job.addTask(task1);
    job.addTask(task2);
    jobService.addJob(job);
    waitForJobFinish(job.getId());
    assertEquals(ExecutableState.ERROR, jobService.getOutput(job.getId()).getState());
    assertEquals(ExecutableState.ERROR, jobService.getOutput(task1.getId()).getState());
    assertEquals(ExecutableState.READY, jobService.getOutput(task2.getId()).getState());
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:14,代码来源:DefaultSchedulerTest.java

示例14: testDiscard

import org.apache.kylin.job.BaseTestExecutable; //导入依赖的package包/类
@Test
public void testDiscard() throws Exception {
    DefaultChainedExecutable job = new DefaultChainedExecutable();
    BaseTestExecutable task1 = new SelfStopExecutable();
    job.addTask(task1);
    jobService.addJob(job);
    waitForJobStatus(job.getId(), ExecutableState.RUNNING, 500);
    jobService.discardJob(job.getId());
    waitForJobFinish(job.getId());
    assertEquals(ExecutableState.DISCARDED, jobService.getOutput(job.getId()).getState());
    assertEquals(ExecutableState.DISCARDED, jobService.getOutput(task1.getId()).getState());
    Thread.sleep(5000);
    System.out.println(job);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:15,代码来源:DefaultSchedulerTest.java


注:本文中的org.apache.kylin.job.BaseTestExecutable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。