@Test public void testParseToJobInstance4CheckpointJob() { Test2Job task = new Test2Job(); String jobId = UUID.randomUUID().toString(); String cubeName = "cube1"; task.setId(jobId); task.setParam(CubingExecutableUtil.CUBE_NAME, cubeName); Map<String, Output> outPutMap = Maps.newHashMap(); DefaultOutput executeOutput = new DefaultOutput(); executeOutput.setState(ExecutableState.READY); Map<String, String> extraMap = Maps.newHashMap(); executeOutput.setExtra(extraMap); outPutMap.put(jobId, executeOutput); JobInstance instance3 = JobInfoConverter.parseToJobInstanceQuietly(task, outPutMap); assertEquals(jobId, instance3.getId()); assertEquals(CubeBuildTypeEnum.CHECKPOINT, instance3.getType()); assertEquals(cubeName, instance3.getRelatedCube()); assertEquals(JobStatusEnum.PENDING, instance3.getStatus()); }
public static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs) { try { if (job instanceof CheckpointExecutable) { return parseToJobInstance((CheckpointExecutable)job, outputs); } else if (job instanceof CubingJob) { return parseToJobInstance((CubingJob)job, outputs); } else { return null; } } catch (Exception e) { logger.error("Failed to parse job instance: uuid={}", job, e); return null; } }
JobInfoConverter { public static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs) { try { if (job instanceof CheckpointExecutable) { return parseToJobInstance((CheckpointExecutable)job, outputs); } else if (job instanceof CubingJob) { return parseToJobInstance((CubingJob)job, outputs); } else { return null; } } catch (Exception e) { logger.error("Failed to parse job instance: uuid={}", job, e); return null; } } }
JobInfoConverter { public static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs) { try { if (job instanceof CheckpointExecutable) { return parseToJobInstance((CheckpointExecutable)job, outputs); } else if (job instanceof CubingJob) { return parseToJobInstance((CubingJob)job, outputs); } else { return null; } } catch (Exception e) { logger.error("Failed to parse job instance: uuid={}", job, e); return null; } }  }
JobInfoConverter { public static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs) { try { if (job instanceof CheckpointExecutable) { return parseToJobInstance((CheckpointExecutable)job, outputs); } else if (job instanceof CubingJob) { return parseToJobInstance((CubingJob)job, outputs); } else { return null; } } catch (Exception e) { logger.error("Failed to parse job instance: uuid={}", job, e); return null; } }  static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CubingJob job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CheckpointExecutable job, Map<String, Output> outputs); static JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i, Output stepOutput); static JobStatusEnum parseToJobStatus(ExecutableState state); static JobStepStatusEnum parseToJobStepStatus(ExecutableState state); static JobSearchResult parseToJobSearchResult(DefaultChainedExecutable job, Map<String, ExecutableOutputPO> outputs); }
JobInfoConverter { public static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs) { try { if (job instanceof CheckpointExecutable) { return parseToJobInstance((CheckpointExecutable)job, outputs); } else if (job instanceof CubingJob) { return parseToJobInstance((CubingJob)job, outputs); } else { return null; } } catch (Exception e) { logger.error("Failed to parse job instance: uuid={}", job, e); return null; } }  static JobInstance parseToJobInstanceQuietly(AbstractExecutable job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CubingJob job, Map<String, Output> outputs); static JobInstance parseToJobInstance(CheckpointExecutable job, Map<String, Output> outputs); static JobInstance.JobStep parseToJobStep(AbstractExecutable task, int i, Output stepOutput); static JobStatusEnum parseToJobStatus(ExecutableState state); static JobStepStatusEnum parseToJobStepStatus(ExecutableState state); static JobSearchResult parseToJobSearchResult(DefaultChainedExecutable job, Map<String, ExecutableOutputPO> outputs);  }