public SchedulableTask(ClusterTask clusterTask, TaskConfig config) { this.taskId = clusterTask.getTaskId(); this.jobId = clusterTask.getJobId(); this.clusterId = clusterTask.getClusterId(); this.taskName = clusterTask.getTaskName().name(); this.nodeId = clusterTask.getNodeId(); this.config = config; }
for (int i = retryActionIndex; i < currentActionIndex; ++i) { ProvisionerAction action = taskOrder.get(i); TaskId retryTaskId = idService.getNewTaskId(JobId.fromString(task.getJobId())); ClusterTask retry = new ClusterTask(action, retryTaskId, task.getNodeId(), task.getService(), task.getClusterAction(), task.getClusterTemplateName(), task.getAccount());
jobQueues.add(queueName, new Element(task.getJobId()));
/** * 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; }
jobQueues.add(queueName, new Element(clusterTask.getJobId()));