Java Code Examples for org.apache.kylin.job.execution.ExecutableState#SUCCEED
The following examples show how to use
org.apache.kylin.job.execution.ExecutableState#SUCCEED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobService.java From Kylin with Apache License 2.0 | 6 votes |
private ExecutableState parseToExecutableState(JobStatusEnum status) { switch (status) { case DISCARDED: return ExecutableState.DISCARDED; case ERROR: return ExecutableState.ERROR; case FINISHED: return ExecutableState.SUCCEED; case NEW: return ExecutableState.READY; case PENDING: return ExecutableState.READY; case RUNNING: return ExecutableState.RUNNING; default: throw new RuntimeException("illegal status:" + status); } }
Example 2
Source File: CubingJob.java From kylin with Apache License 2.0 | 6 votes |
protected void updateMetrics(ExecutableContext context, ExecuteResult result, ExecutableState state) { JobMetricsFacade.JobStatisticsResult jobStats = new JobMetricsFacade.JobStatisticsResult(); jobStats.setWrapper(getSubmitter(), getProjectName(), CubingExecutableUtil.getCubeName(getParams()), getId(), getJobType(), getAlgorithm() == null ? "NULL" : getAlgorithm().toString()); if (state == ExecutableState.SUCCEED) { jobStats.setJobStats(findSourceSizeBytes(), findCubeSizeBytes(), getDuration(), getMapReduceWaitTime(), getPerBytesTimeCost(findSourceSizeBytes(), getDuration())); if (CubingJobTypeEnum.getByName(getJobType()) == CubingJobTypeEnum.BUILD) { jobStats.setJobStepStats(getTaskDurationByName(ExecutableConstants.STEP_NAME_FACT_DISTINCT_COLUMNS), getTaskDurationByName(ExecutableConstants.STEP_NAME_BUILD_DICTIONARY), getTaskDurationByName(ExecutableConstants.STEP_NAME_BUILD_IN_MEM_CUBE), getTaskDurationByName(ExecutableConstants.STEP_NAME_CONVERT_CUBOID_TO_HFILE)); } } else if (state == ExecutableState.ERROR) { jobStats.setJobException(result.getThrowable() != null ? result.getThrowable() : new Exception()); } JobMetricsFacade.updateMetrics(jobStats); }
Example 3
Source File: CubeMetadataUpgrade.java From Kylin with Apache License 2.0 | 6 votes |
private ExecutableState parseState(JobStatusEnum state) { switch (state) { case NEW: case PENDING: return ExecutableState.READY; case RUNNING: return ExecutableState.RUNNING; case FINISHED: return ExecutableState.SUCCEED; case ERROR: return ExecutableState.ERROR; case DISCARDED: return ExecutableState.DISCARDED; default: return ExecutableState.DISCARDED; } }
Example 4
Source File: CubeService.java From kylin with Apache License 2.0 | 6 votes |
protected void releaseAllJobs(CubeInstance cube) { final List<CubingJob> cubingJobs = jobService.listJobsByRealizationName(cube.getName(), null); for (CubingJob cubingJob : cubingJobs) { final ExecutableState status = cubingJob.getStatus(); if (status != ExecutableState.SUCCEED && status != ExecutableState.DISCARDED) { getExecutableManager().discardJob(cubingJob.getId()); //release global dict lock if exists DistributedLock lock = KylinConfig.getInstanceFromEnv().getDistributedLockFactory() .lockForCurrentThread(); if (lock.isLocked(CubeJobLockUtil.getLockPath(cube.getName(), cubingJob.getId()))) {//release cube job dict lock if exists lock.purgeLocks(CubeJobLockUtil.getLockPath(cube.getName(), null)); logger.info("{} unlock cube job global lock path({}) success", cubingJob.getId(), CubeJobLockUtil.getLockPath(cube.getName(), null)); if (lock.isLocked(CubeJobLockUtil.getEphemeralLockPath(cube.getName()))) {//release cube job Ephemeral lock if exists lock.purgeLocks(CubeJobLockUtil.getEphemeralLockPath(cube.getName())); logger.info("{} unlock cube job ephemeral lock path({}) success", cubingJob.getId(), CubeJobLockUtil.getEphemeralLockPath(cube.getName())); } } } } }
Example 5
Source File: CubeMetadataUpgrade.java From Kylin with Apache License 2.0 | 6 votes |
private ExecutableState parseState(JobStepStatusEnum state) { switch (state) { case NEW: case PENDING: case WAITING: return ExecutableState.READY; case RUNNING: return ExecutableState.RUNNING; case FINISHED: return ExecutableState.SUCCEED; case ERROR: return ExecutableState.ERROR; case DISCARDED: return ExecutableState.DISCARDED; default: return ExecutableState.DISCARDED; } }
Example 6
Source File: JobService.java From kylin with Apache License 2.0 | 6 votes |
private ExecutableState parseToExecutableState(JobStatusEnum status) { Message msg = MsgPicker.getMsg(); switch (status) { case DISCARDED: return ExecutableState.DISCARDED; case ERROR: return ExecutableState.ERROR; case FINISHED: return ExecutableState.SUCCEED; case NEW: return ExecutableState.READY; case PENDING: return ExecutableState.READY; case RUNNING: return ExecutableState.RUNNING; case STOPPED: return ExecutableState.STOPPED; default: throw new BadRequestException(String.format(Locale.ROOT, msg.getILLEGAL_EXECUTABLE_STATE(), status)); } }
Example 7
Source File: FetcherRunner.java From kylin-on-parquet-v2 with Apache License 2.0 | 6 votes |
protected void jobStateCount(String id) { final Output outputDigest = getExecutableManager().getOutputDigest(id); // logger.debug("Job id:" + id + " not runnable"); if (outputDigest.getState() == ExecutableState.SUCCEED) { succeedJobs.add(id); nSUCCEED++; } else if (outputDigest.getState() == ExecutableState.ERROR) { nError++; } else if (outputDigest.getState() == ExecutableState.DISCARDED) { nDiscarded++; } else if (outputDigest.getState() == ExecutableState.STOPPED) { nStopped++; } else { if (fetchFailed) { getExecutableManager().forceKillJob(id); nError++; } else { nOthers++; } } }
Example 8
Source File: CubeService.java From kylin-on-parquet-v2 with Apache License 2.0 | 6 votes |
protected void releaseAllJobs(CubeInstance cube) { final List<CubingJob> cubingJobs = jobService.listJobsByRealizationName(cube.getName(), null); for (CubingJob cubingJob : cubingJobs) { final ExecutableState status = cubingJob.getStatus(); if (status != ExecutableState.SUCCEED && status != ExecutableState.DISCARDED) { getExecutableManager().discardJob(cubingJob.getId()); //release global dict lock if exists DistributedLock lock = KylinConfig.getInstanceFromEnv().getDistributedLockFactory() .lockForCurrentThread(); if (lock.isLocked(CubeJobLockUtil.getLockPath(cube.getName(), cubingJob.getId()))) {//release cube job dict lock if exists lock.purgeLocks(CubeJobLockUtil.getLockPath(cube.getName(), null)); logger.info("{} unlock cube job global lock path({}) success", cubingJob.getId(), CubeJobLockUtil.getLockPath(cube.getName(), null)); if (lock.isLocked(CubeJobLockUtil.getEphemeralLockPath(cube.getName()))) {//release cube job Ephemeral lock if exists lock.purgeLocks(CubeJobLockUtil.getEphemeralLockPath(cube.getName())); logger.info("{} unlock cube job ephemeral lock path({}) success", cubingJob.getId(), CubeJobLockUtil.getEphemeralLockPath(cube.getName())); } } } } }
Example 9
Source File: BuildCubeWithEngine.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
protected ExecutableState waitForJob(String jobId) { while (true) { AbstractExecutable job = jobService.getJob(jobId); if (job.getStatus() == ExecutableState.SUCCEED || job.getStatus() == ExecutableState.ERROR) { return job.getStatus(); } else { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 10
Source File: BaseTestDistributedScheduler.java From kylin with Apache License 2.0 | 5 votes |
void waitForJobFinish(String jobId) { while (true) { AbstractExecutable job = execMgr.getJob(jobId); final ExecutableState status = job.getStatus(); if (status == ExecutableState.SUCCEED || status == ExecutableState.ERROR || status == ExecutableState.STOPPED || status == ExecutableState.DISCARDED) { break; } else { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 11
Source File: JobInfoConverterTest.java From kylin with Apache License 2.0 | 5 votes |
@Test public void testParseToJobStatusReturnsJobStatusFinished() { ExecutableState executableState = ExecutableState.SUCCEED; JobStatusEnum jobStatusEnum = JobInfoConverter.parseToJobStatus(executableState); assertEquals(4, jobStatusEnum.getCode()); assertEquals(JobStatusEnum.FINISHED, jobStatusEnum); }
Example 12
Source File: BuildCubeWithEngine.java From kylin with Apache License 2.0 | 5 votes |
protected ExecutableState waitForJob(String jobId) { while (true) { AbstractExecutable job = jobService.getJob(jobId); if (job.getStatus() == ExecutableState.SUCCEED || job.getStatus() == ExecutableState.ERROR) { return job.getStatus(); } else { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 13
Source File: BuildCubeWithStream.java From kylin with Apache License 2.0 | 5 votes |
protected void waitForJob(String jobId) { while (true) { AbstractExecutable job = jobService.getJob(jobId); if (job.getStatus() == ExecutableState.SUCCEED || job.getStatus() == ExecutableState.ERROR || job.getStatus() == ExecutableState.DISCARDED) { break; } else { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 14
Source File: BuildCubeWithEngineTest.java From Kylin with Apache License 2.0 | 5 votes |
protected void waitForJob(String jobId) { while (true) { AbstractExecutable job = jobService.getJob(jobId); if (job.getStatus() == ExecutableState.SUCCEED || job.getStatus() == ExecutableState.ERROR) { break; } else { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 15
Source File: BaseSchedulerTest.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
protected void waitForJobFinish(String jobId, int maxWaitTime) { int error = 0; long start = System.currentTimeMillis(); final int errorLimit = 3; while (error < errorLimit && (System.currentTimeMillis() - start < maxWaitTime)) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } try { AbstractExecutable job = execMgr.getJob(jobId); ExecutableState status = job.getStatus(); if (status == ExecutableState.SUCCEED || status == ExecutableState.ERROR || status == ExecutableState.STOPPED || status == ExecutableState.DISCARDED) { break; } } catch (Exception ex) { logger.error("", ex); error++; } } if (error >= errorLimit) { throw new RuntimeException("too many exceptions"); } if (System.currentTimeMillis() - start >= maxWaitTime) { throw new RuntimeException("too long wait time"); } }
Example 16
Source File: JobInfoConverterTest.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
@Test public void testParseToJobStatusReturnsJobStatusFinished() { ExecutableState executableState = ExecutableState.SUCCEED; JobStatusEnum jobStatusEnum = JobInfoConverter.parseToJobStatus(executableState); assertEquals(4, jobStatusEnum.getCode()); assertEquals(JobStatusEnum.FINISHED, jobStatusEnum); }
Example 17
Source File: CubingJob.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
@Override protected void onExecuteFinished(ExecuteResult result, ExecutableContext executableContext) { long time = 0L; for (AbstractExecutable task : getTasks()) { final ExecutableState status = task.getStatus(); if (status != ExecutableState.SUCCEED) { break; } if (task instanceof MapReduceExecutable) { time += ((MapReduceExecutable) task).getMapReduceWaitTime(); } } setMapReduceWaitTime(time); super.onExecuteFinished(result, executableContext); }
Example 18
Source File: BaseTestDistributedScheduler.java From kylin-on-parquet-v2 with Apache License 2.0 | 5 votes |
void waitForJobFinish(String jobId) { while (true) { AbstractExecutable job = execMgr.getJob(jobId); final ExecutableState status = job.getStatus(); if (status == ExecutableState.SUCCEED || status == ExecutableState.ERROR || status == ExecutableState.STOPPED || status == ExecutableState.DISCARDED) { break; } else { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 19
Source File: BuildIIWithEngineTest.java From Kylin with Apache License 2.0 | 5 votes |
protected void waitForJob(String jobId) { while (true) { AbstractExecutable job = jobService.getJob(jobId); if (job.getStatus() == ExecutableState.SUCCEED || job.getStatus() == ExecutableState.ERROR) { break; } else { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Example 20
Source File: JobInfoConverterTest.java From kylin with Apache License 2.0 | 4 votes |
@Override public ExecutableState getState() { return ExecutableState.SUCCEED; }