try { taskManagerHelper.setTaskInStoppedStatus(task); updateExecutorRegistry(task); } catch (Exception e) { logger.error("It was not possible to update task: " + task.getId() + " during " +
try { taskManagerHelper.setTaskInStoppedStatus(task); updateExecutorRegistry(task); } catch (Exception e) { logger.error("It was not possible to update task: " + task.getId() + " during " +
private void beforePipelineExecution(final BeforePipelineExecutionEvent bpee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.RUNNING); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void afterPipelineExecution(final AfterPipelineExecutionEvent apee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.FINISHED); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void beforePipelineExecution(final BeforePipelineExecutionEvent bpee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.RUNNING); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void afterPipelineExecution(final AfterPipelineExecutionEvent apee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.FINISHED); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
/** * Executes the task definition in asynchronous mode. * @param taskDef task definition for executing. * @return the taskId assigned to the running task. * @see PipelineExecutorTaskDef */ private synchronized String executeAsync(final PipelineExecutorTaskDef taskDef) { final PipelineExecutorTaskImpl task = taskManagerHelper.createTask(taskDef); storeTaskEntry(TaskEntry.newAsyncEntry(task)); startAsyncTask(task); updateExecutorRegistry(task); return task.getId(); }
/** * Executes the task definition in asynchronous mode. * @param taskDef task definition for executing. * @return the taskId assigned to the running task. * @see PipelineExecutorTaskDef */ private synchronized String executeAsync(final PipelineExecutorTaskDef taskDef) { final PipelineExecutorTaskImpl task = taskManagerHelper.createTask(taskDef); storeTaskEntry(TaskEntry.newAsyncEntry(task)); startAsyncTask(task); updateExecutorRegistry(task); return task.getId(); }
private void afterStageExecution(final AfterStageExecutionEvent asee, final TaskEntry taskEntry) { taskEntry.getTask().setStageStatus(asee.getStage().getName(), PipelineExecutorTask.Status.FINISHED); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void beforeStageExecution(final BeforeStageExecutionEvent bsee, final TaskEntry taskEntry) { taskEntry.getTask().setStageStatus(bsee.getStage().getName(), PipelineExecutorTask.Status.RUNNING); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void beforeStageExecution(final BeforeStageExecutionEvent bsee, final TaskEntry taskEntry) { taskEntry.getTask().setStageStatus(bsee.getStage().getName(), PipelineExecutorTask.Status.RUNNING); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void afterStageExecution(final AfterStageExecutionEvent asee, final TaskEntry taskEntry) { taskEntry.getTask().setStageStatus(asee.getStage().getName(), PipelineExecutorTask.Status.FINISHED); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void onPipelineError(final OnErrorPipelineExecutionEvent oepee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setPipelineError(new PipelineExecutorException(oepee.getError().getMessage(), oepee.getError())); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void onPipelineError(final OnErrorPipelineExecutionEvent oepee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setPipelineError(new PipelineExecutorError(oepee.getError().getMessage(), oepee.getError())); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void onStageError(final OnErrorStageExecutionEvent oesee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setStageStatus(oesee.getStage().getName(), PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setStageError(oesee.getStage().getName(), new PipelineExecutorError(oesee.getError().getMessage(), oesee.getError())); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
private void onStageError(final OnErrorStageExecutionEvent oesee, final TaskEntry taskEntry) { taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setStageStatus(oesee.getStage().getName(), PipelineExecutorTask.Status.ERROR); taskEntry.getTask().setStageError(oesee.getStage().getName(), new PipelineExecutorException(oesee.getError().getMessage(), oesee.getError())); if (taskEntry.isAsync()) { updateExecutorRegistry(taskEntry.getTask()); } }
@Override public void stop(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } if (!entry.isAsync()) { throw new PipelineExecutorException("Stop operation is not available for taskId: " + taskId + " running in SYNCHRONOUS mode"); } final PipelineExecutorTask.Status currentStatus = entry.getTask().getPipelineStatus(); if (!stopEnabledStatus.contains(currentStatus)) { throw new PipelineExecutorException("A PipelineExecutorTask in status: " + currentStatus.name() + " can not" + " be stopped. Stop operation is available for the following status set: " + stopEnabledStatus); } destroyFutureTask(taskId); removeTaskEntry(taskId); taskManagerHelper.setTaskInStoppedStatus(entry.getTask()); updateExecutorRegistry(entry.getTask()); }
@Override public void stop(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } if (!entry.isAsync()) { throw new PipelineExecutorException("Stop operation is not available for taskId: " + taskId + " running in SYNCHRONOUS mode"); } final PipelineExecutorTask.Status currentStatus = entry.getTask().getPipelineStatus(); if (!stopEnabledStatus.contains(currentStatus)) { throw new PipelineExecutorException("A PipelineExecutorTask in status: " + currentStatus.name() + " can not" + " be stopped. Stop operation is available for the following status set: " + stopEnabledStatus); } destroyFutureTask(taskId); removeTaskEntry(taskId); taskManagerHelper.setTaskInStoppedStatus(entry.getTask()); updateExecutorRegistry(entry.getTask()); }
/** * Executes a task definition in synchronous mode. * @param taskDef task definition for executing. * @return the taskId assigned to the executed task. */ private String executeSync(final PipelineExecutorTaskDef taskDef) { final PipelineExecutorTaskImpl task = taskManagerHelper.createTask(taskDef); storeTaskEntry(TaskEntry.newSyncEntry(task)); final Pipeline pipeline = pipelineRegistry.getPipelineByName(taskDef.getPipeline()); pipelineExecutor.execute(taskDef.getInput(), pipeline, output -> processPipelineOutput(task, output), localListener); removeTaskEntry(task.getId()); updateExecutorRegistry(task); return task.getId(); }
/** * Executes a task definition in synchronous mode. * @param taskDef task definition for executing. * @return the taskId assigned to the executed task. */ private String executeSync(final PipelineExecutorTaskDef taskDef) { final PipelineExecutorTaskImpl task = taskManagerHelper.createTask(taskDef); storeTaskEntry(TaskEntry.newSyncEntry(task)); final Pipeline pipeline = pipelineRegistry.getPipelineByName(taskDef.getPipeline()); pipelineExecutor.execute(taskDef.getInput(), pipeline, output -> processPipelineOutput(task, output), localListener); removeTaskEntry(task.getId()); updateExecutorRegistry(task); return task.getId(); }