private void processPipelineOutput(final PipelineExecutorTask task, final Object output) { if (output instanceof RegistrableOutput) { ((PipelineExecutorTaskImpl) task).setOutput((RegistrableOutput) output); } else { //uncommon case logger.debug("Only pipeline outputs of type RegistrableOutput will be registered" + ", current output value won't be registered: " + output); } }
private void processPipelineOutput(final PipelineExecutorTask task, final Object output) { if (output instanceof RegistrableOutput) { ((PipelineExecutorTaskImpl) task).setOutput((RegistrableOutput) output); } else { //uncommon case logger.debug("Only pipeline outputs of type RegistrableOutput will be registered" + ", current output value won't be registered: " + output); } }
@Override protected Object clone() throws CloneNotSupportedException { PipelineExecutorTaskImpl clone = new PipelineExecutorTaskImpl(taskDef, executionId); clone.setPipelineStatus(this.getPipelineStatus()); stageStatus.forEach(clone::setStageStatus); stageError.forEach(clone::setStageError); clone.setPipelineError(pipelineError); clone.setOutput(output); return clone; } }
@Override protected Object clone() throws CloneNotSupportedException { PipelineExecutorTaskImpl clone = new PipelineExecutorTaskImpl(taskDef, executionId); clone.setPipelineStatus(this.getPipelineStatus()); stageStatus.forEach(clone::setStageStatus); stageError.forEach(clone::setStageError); clone.setPipelineError(pipelineError); clone.setOutput(output); return clone; } }
public void setTaskInStoppedStatus(final PipelineExecutorTaskImpl task) { task.setPipelineStatus(PipelineExecutorTask.Status.STOPPED); task.getTaskDef().getStages() .stream() .filter(stage -> PipelineExecutorTask.Status.RUNNING.equals(task.getStageStatus(stage)) || PipelineExecutorTask.Status.SCHEDULED.equals(task.getStageStatus(stage))) .forEach(stage -> task.setStageStatus(stage, PipelineExecutorTask.Status.STOPPED)); task.clearErrors(); task.setOutput(null); } }
public void setTaskInStoppedStatus(final PipelineExecutorTaskImpl task) { task.setPipelineStatus(PipelineExecutorTask.Status.STOPPED); task.getTaskDef().getStages() .stream() .filter(stage -> PipelineExecutorTask.Status.RUNNING.equals(task.getStageStatus(stage)) || PipelineExecutorTask.Status.SCHEDULED.equals(task.getStageStatus(stage))) .forEach(stage -> task.setStageStatus(stage, PipelineExecutorTask.Status.STOPPED)); task.clearErrors(); task.setOutput(null); } }
@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); }
@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); }