List<ProvisionerAction> taskOrder = actions.getActionOrder().get(task.getClusterAction()); if (taskOrder == null) { throw new IllegalStateException("Not able to get task order for action " + task.getClusterAction()); TaskId retryTaskId = idService.getNewTaskId(JobId.fromString(task.getJobId())); ClusterTask retry = new ClusterTask(action, retryTaskId, task.getNodeId(), task.getService(), task.getClusterAction(), task.getClusterTemplateName(), task.getAccount()); retryTasks.add(retry);
/** * Get the rollback task that should run if the given task fails. * * @param task Task that needs to get rolled back. * @return Cluster task that will roll back the given failed task. */ private ClusterTask getRollbackTask(ClusterTask task) { ProvisionerAction rollback = actions.getRollbackActions().get(task.getTaskName()); if (rollback == null) { return null; } TaskId rollbackTaskId = idService.getNewTaskId(JobId.fromString(task.getJobId())); ClusterTask rollbackTask = new ClusterTask(rollback, rollbackTaskId, task.getNodeId(), task.getService(), task.getClusterAction(), task.getClusterTemplateName(), task.getAccount()); return rollbackTask; }