Get task states of {@link Task}s of this job as {@link WorkUnitState}s.

@return a list of {@link WorkUnitState}s
193493
public List<WorkUnitState> getTaskStatesAsWorkUnitStates() {
    ImmutableList.Builder<WorkUnitState> builder = ImmutableList.builder();
    for (TaskState taskState : this.taskStates.values()) {
      WorkUnitState workUnitState = new WorkUnitState(taskState.getWorkunit(), taskState.getJobState());
      workUnitState.setId(taskState.getId());
      workUnitState.addAll(taskState);
      builder.add(workUnitState);
    }

    return builder.build();
  }
1204007
public int getCompletedTasks() {
    int completedTasks = 0;
    for (TaskState taskState : this.taskStates.values()) {
      if (taskState.isCompleted()) {
        completedTasks++;
      }
    }

    return completedTasks;
  }
324186
public static List<KeyedStateHandle> getKeyedStateHandles(
		Collection<? extends KeyedStateHandle> keyedStateHandles,
		KeyGroupRange subtaskKeyGroupRange) {

		List<KeyedStateHandle> subtaskKeyedStateHandles = new ArrayList<>(keyedStateHandles.size());

		for (KeyedStateHandle keyedStateHandle : keyedStateHandles) {
			KeyedStateHandle intersectedKeyedStateHandle = keyedStateHandle.getIntersection(subtaskKeyGroupRange);

			if (intersectedKeyedStateHandle != null) {
				subtaskKeyedStateHandles.add(intersectedKeyedStateHandle);
			}
		}

		return subtaskKeyedStateHandles;
	}
249711
public java.util.List<JobFlowDetail> getJobFlows() {
        if (jobFlows == null) {
            jobFlows = new com.amazonaws.internal.SdkInternalList<JobFlowDetail>();
        }
        return jobFlows;
    }
733892
public java.util.List<ExportTask> getExportTasks() {
        if (exportTasks == null) {
            exportTasks = new com.amazonaws.internal.SdkInternalList<ExportTask>();
        }
        return exportTasks;
    }
198442
public Task poll() {
        Task result = taskList[activeIndex].poll();
        if (result != null) {
            if (activeIndex == 0)
                result.removeFromQueue0();
            else
                result.removeFromQueue1();
        }

        return result;
    }
1182222
def tasks(self):
        
        if self._tasks is None:
            self._tasks = TaskList(self._version, workspace_sid=self._solution['sid'], )
        return self._tasks
980931
public AbstractJobVertex[] getAllJobVertices() {

		int i = 0;
		final AbstractJobVertex[] vertices = new AbstractJobVertex[inputVertices.size() + outputVertices.size()
			+ taskVertices.size()];

		final Iterator<AbstractJobInputVertex> iv = getInputVertices();
		while (iv.hasNext()) {
			vertices[i++] = iv.next();
		}

		final Iterator<AbstractJobOutputVertex> ov = getOutputVertices();
		while (ov.hasNext()) {
			vertices[i++] = ov.next();
		}

		final Iterator<JobTaskVertex> tv = getTaskVertices();
		while (tv.hasNext()) {
			vertices[i++] = tv.next();
		}

		return vertices;
	}
149360
List<CommitTaskAction> getCommitActions(TaskTrackerStatus tts) {
    synchronized (lockObject) {
      List<CommitTaskAction> saveList = new ArrayList<CommitTaskAction>();
      List<TaskStatus> taskStatuses = tts.getTaskReports();
      if (taskStatuses != null) {
        for (TaskStatus taskStatus : taskStatuses) {
          if (taskStatus.getRunState() == TaskStatus.State.COMMIT_PENDING) {
            TaskAttemptID taskId = taskStatus.getTaskID();
            TaskInProgress tip = taskLookupTable.getTIP(taskId);
            if (tip == null) {
              continue;
            }
            if (tip.shouldCommit(taskId)) {
              CommitTaskAction commitAction = new CommitTaskAction(taskId);
              saveList.add(commitAction);
              LOG.debug(tts.getTrackerName() +
                  " -> CommitTaskAction: " + taskId);
            }
          }
        }
      }
      return saveList;
    }
  }
598853
public static TaskMetrics get(final TaskState taskState) {
    return (TaskMetrics) GOBBLIN_METRICS_REGISTRY.getOrDefault(name(taskState), new Callable<GobblinMetrics>() {
      @Override
      public GobblinMetrics call() throws Exception {
        return new TaskMetrics(taskState);
      }
    });
  }
979265
@Nonnull
    public List<S> bfsStates() {
        List<S> stateList = new ArrayList<>();
        Set<S> visited = new HashSet<>();

        int ptr = 0;
        stateList.add(root);
        visited.add(root);
        int numStates = 1;

        while (ptr < numStates) {
            S curr = stateList.get(ptr++);
            for (int i = 0; i < alphabetSize; i++) {
                S succ = curr.getSuccessor(i);
                if (succ != null && visited.add(succ)) {
                    stateList.add(succ);
                    numStates++;
                }
            }
        }

        return stateList;
    }
798493
private java.util.Map<JobHistory.Keys, String> getLastSuccessfulTaskAttempt(JobHistory.Task task) {
    
    Map<String, JobHistory.TaskAttempt> taskAttempts = task.getTaskAttempts();
    int size = taskAttempts.size();
    java.util.Iterator<Map.Entry<String, JobHistory.TaskAttempt>> kv = taskAttempts.entrySet().iterator();
    for (int i=0; i<size; i++) {
      // CHECK_IT: Only one SUCCESSFUL TASK ATTEMPT
      Map.Entry<String, JobHistory.TaskAttempt> tae = kv.next();
      JobHistory.TaskAttempt attempt = tae.getValue();
      if (attempt.getValues().get(JobHistory.Keys.TASK_STATUS).equals("SUCCESS")) {
        return attempt.getValues();
      }
    }
    
    return null;
  }
750783
public java.util.List<String> getTaskIds() {
        if (taskIds == null) {
            taskIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return taskIds;
    }
256279
private List<TaskTrackerAction> getJobsForCleanup(String taskTracker) {
    Set<JobID> jobs = null;
    synchronized (trackerToJobsToCleanup) {
      jobs = trackerToJobsToCleanup.remove(taskTracker);
    }
    if (jobs != null) {
      // prepare the actions list
      List<TaskTrackerAction> killList = new ArrayList<TaskTrackerAction>();
      for (JobID killJobId : jobs) {
        killList.add(new KillJobAction(killJobId));
        LOG.debug(taskTracker + " -> KillJobAction: " + killJobId);
      }

      return killList;
    }
    return null;
  }
1085836
public static Map<String,List<TaskAction>> getTaskStatusAllowableActions() throws IOException, XmlException {
        if (taskStatusAllowableActions == null) {
            taskStatusAllowableActions = new HashMap<String,List<TaskAction>>();
            for (TaskActionStatus taskActionStatus : getTaskActions().getTaskDetailActions().getTaskStatusList()) {
                String status = taskActionStatus.getStatus();
                List<TaskAction> taskActions = new ArrayList<TaskAction>();
                taskStatusAllowableActions.put(status, taskActions);
                for (AllowableAction allowableAction: taskActionStatus.getAllowableActionList()) {
                    TaskAction taskAction = convertToJsonable(allowableAction);
                    if (!taskActions.contains(taskAction))
                        taskActions.add(taskAction);
                }
            }
        }
        return taskStatusAllowableActions;
    }
794291
public List<AbstractProject> getTiedJobs() {
        Node node = getNode();
        return (node != null) ? node.getSelfLabel().getTiedJobs() : Collections.EMPTY_LIST;
    }
874262
public List<Task> getActiveTasks() {
        InputStream response = null;
        URI uri = new URIBase(getBaseUri()).path("_active_tasks").build();
        try {
            response = couchDbClient.get(uri);
            return getResponseList(response, couchDbClient.getGson(), DeserializationTypes.TASKS);
        } finally {
            close(response);
        }
    }