private void updateExecutorRegistry(final PipelineExecutorTaskImpl task) { try { PipelineExecutorTaskImpl clone = (PipelineExecutorTaskImpl) task.clone(); pipelineExecutorRegistry.register(new PipelineExecutorTraceImpl(clone)); } catch (Exception e) { //clone is supported by construction, since PipelineExecutorTaskImpl is clonable. logger.error("Unexpected error: " + e.getMessage(), e); } }
/** * Shortcut to the task id. * @return returns the id of the internal task. */ @JsonIgnore public String getTaskId() { return getTask().getId(); }
private void assertEqualsPipelineExecutorTrace(PipelineExecutorTraceImpl expectedValue, PipelineExecutorTraceImpl value) { assertEquals(expectedValue.getTaskId(), value.getTaskId()); assertEquals(expectedValue.getPipelineId(), value.getPipelineId()); assertEquals(expectedValue.getTask().getTaskDef(), value.getTask().getTaskDef()); assertEquals(expectedValue.getTask().getPipelineStatus(), value.getTask().getPipelineStatus()); assertEquals(expectedValue.getTask().getPipelineError(), value.getTask().getPipelineError()); for (String stage : expectedValue.getTask().getTaskDef().getStages()) { assertEquals(expectedValue.getTask().getStageStatus(stage), value.getTask().getStageStatus(stage)); assertEquals(expectedValue.getTask().getStageError(stage), value.getTask().getStageError(stage)); } assertEquals(expectedValue.getTask().getOutput(), value.getTask().getOutput()); }
private void assertEqualsPipelineExecutorTrace(PipelineExecutorTraceImpl expectedValue, PipelineExecutorTraceImpl value) { assertEquals(expectedValue.getTaskId(), value.getTaskId()); assertEquals(expectedValue.getPipelineId(), value.getPipelineId()); assertEquals(expectedValue.getTask().getTaskDef(), value.getTask().getTaskDef()); assertEquals(expectedValue.getTask().getPipelineStatus(), value.getTask().getPipelineStatus()); assertEqualsPipelineExecutorException(expectedValue.getTask().getPipelineError(), value.getTask().getPipelineError()); for (String stage : expectedValue.getTask().getTaskDef().getStages()) { assertEquals(expectedValue.getTask().getStageStatus(stage), value.getTask().getStageStatus(stage)); assertEqualsPipelineExecutorException(expectedValue.getTask().getStageError(stage), value.getTask().getStageError(stage)); } assertEquals(expectedValue.getTask().getOutput(), value.getTask().getOutput()); }
/** * Shortcut to the task id. * @return returns the id of the internal task. */ @JsonIgnore public String getTaskId() { return getTask().getId(); }
private void updateExecutorRegistry(final PipelineExecutorTaskImpl task) { try { PipelineExecutorTaskImpl clone = (PipelineExecutorTaskImpl) task.clone(); pipelineExecutorRegistry.register(new PipelineExecutorTraceImpl(clone)); } catch (Exception e) { //clone is supported by construction, since PipelineExecutorTaskImpl is clonable. logger.error("Unexpected error: " + e.getMessage(), e); } }
@JsonIgnore @Override public String getPipelineId() { return getTask().getTaskDef().getPipeline(); }
@Override public PipelineExecutorTraceImpl getValue() { //only the stage names are used by the taskDef, so the pipeline can be mocked. List<Stage> stages = mockStages(STAGE_COUNT); Pipeline pipeline = new BasePipeline(PIPELINE_NAME, stages) { }; Input input = mockInput(PIPELINE_INPUT_SIZE); PipelineExecutorTaskDefImpl taskDef = new PipelineExecutorTaskDefImpl(pipeline, input); PipelineExecutorTaskImpl taskImpl = new PipelineExecutorTaskImpl(taskDef, PIPELINE_EXECUTION_ID); taskImpl.setPipelineStatus(PipelineExecutorTask.Status.SCHEDULED); taskImpl.setPipelineError(mockError(PIPELINE_ERROR, PIPELINE_ERROR_DETAIL)); taskImpl.getTaskDef().getStages().forEach(stage -> taskImpl.setStageError(stage, mockStageError(stage))); taskImpl.setOutput(new MockPipelineOutput(PIPELINE_OUTPUT)); return new PipelineExecutorTraceImpl(taskImpl); }
@JsonIgnore @Override public String getPipelineId() { return getTask().getTaskDef().getPipeline(); }
@Override public PipelineExecutorTraceImpl getValue() { //only the stage names are used by the taskDef, so the pipeline can be mocked. List<Stage> stages = mockStages(STAGE_COUNT); Pipeline pipeline = new BasePipeline(PIPELINE_NAME, stages); Input input = mockInput(PIPELINE_INPUT_SIZE); PipelineExecutorTaskDefImpl taskDef = new PipelineExecutorTaskDefImpl(pipeline, input); PipelineExecutorTaskImpl taskImpl = new PipelineExecutorTaskImpl(taskDef, PIPELINE_EXECUTION_ID); taskImpl.setPipelineStatus(PipelineExecutorTask.Status.SCHEDULED); taskImpl.setPipelineError(mockError(PIPELINE_ERROR)); taskImpl.getTaskDef().getStages().forEach(stage -> taskImpl.setStageError(stage, mockStageError(stage))); taskImpl.setOutput(new MockPipelineOutput(PIPELINE_OUTPUT)); return new PipelineExecutorTraceImpl(taskImpl); }