本文整理汇总了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());
}
示例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);
}
示例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());
}
示例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()));
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}