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); } }
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); } }
@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); }