當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。