/** * 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; }