Updates internal status with given tasks.

@param taskInfoList List of @TaskInfo instances to update
430468
public synchronized void updateTasks(List<TaskInfo> taskInfoList) {
    for (TaskInfo taskInfo : taskInfoList) {
      mJobInfo.setTaskInfo(taskInfo.getTaskId(), taskInfo);
    }
    updateStatus();
  }
354403
private void addToTotalCount(final List<TotalTargetCountActionStatus> targetCountActionStatus) {
        if (targetCountActionStatus == null) {
            statusTotalCountMap.put(TotalTargetCountStatus.Status.NOTSTARTED, totalTargetCount);
            return;
        }
        statusTotalCountMap.put(Status.RUNNING, 0L);
        Long notStartedTargetCount = totalTargetCount;
        for (final TotalTargetCountActionStatus item : targetCountActionStatus) {
            addToTotalCount(item);
            notStartedTargetCount -= item.getCount();
        }
        statusTotalCountMap.put(TotalTargetCountStatus.Status.NOTSTARTED, notStartedTargetCount);
    }
51340
public void setList(List<T> list) {
        if (list != mList) {
            mList = list;
            if (mList == null) {
                notifyInvalidated();
            } else {
                notifyChanged();
            }
        }
    }
1317073
public void setClusterInfoList(java.util.Collection<ClusterInfo> clusterInfoList) {
        if (clusterInfoList == null) {
            this.clusterInfoList = null;
            return;
        }

        this.clusterInfoList = new java.util.ArrayList<ClusterInfo>(clusterInfoList);
    }
747697
private void processTasks()
   {
      int uniqueID = 0;

      FastTrackTable activities = m_data.getTable(FastTrackTableType.ACTIVITIES);
      for (MapRow row : activities)
      {
         ++uniqueID;

         Integer id = row.getInteger(ActivityField.ACTIVITY_ROW_ID);
         if (id == null || id.intValue() < 1)
         {
            continue;
         }

         Task task = m_project.addTask();
         task.setName(row.getString(ActivityField.ACTIVITY_NAME));
         task.setID(id);
         task.setUniqueID(Integer.valueOf(uniqueID));
         //  Activity Row Number
         task.setFlag(1, row.getBoolean(ActivityField.FLAG_1));
         task.setFlag(2, row.getBoolean(ActivityField.FLAG_2));
         task.setFlag(3, row.getBoolean(ActivityField.FLAG_3));
         task.setFlag(4, row.getBoolean(ActivityField.FLAG_4));
         task.setFlag(5, row.getBoolean(ActivityField.FLAG_5));
         task.setFlag(6, row.getBoolean(ActivityField.FLAG_6));
         task.setFlag(7, row.getBoolean(ActivityField.FLAG_7));
         task.setFlag(8, row.getBoolean(ActivityField.FLAG_8));
         task.setFlag(9, row.getBoolean(ActivityField.FLAG_9));
         task.setFlag(10, row.getBoolean(ActivityField.FLAG_10));
         task.setFlag(11, row.getBoolean(ActivityField.FLAG_11));
         task.setFlag(12, row.getBoolean(ActivityField.FLAG_12));
         task.setFlag(13, row.getBoolean(ActivityField.FLAG_13));
         task.setFlag(14, row.getBoolean(ActivityField.FLAG_14));
         task.setFlag(15, row.getBoolean(ActivityField.FLAG_15));
         task.setFlag(16, row.getBoolean(ActivityField.FLAG_16));
         task.setFlag(17, row.getBoolean(ActivityField.FLAG_17));
         task.setFlag(18, row.getBoolean(ActivityField.FLAG_18));
         task.setFlag(19, row.getBoolean(ActivityField.FLAG_19));
         task.setFlag(20, row.getBoolean(ActivityField.FLAG_20));
         //   Parent Tree
         task.setText(1, row.getString(ActivityField.TEXT_1));
         task.setText(2, row.getString(ActivityField.TEXT_2));
         task.setText(3, row.getString(ActivityField.TEXT_3));
         task.setText(4, row.getString(ActivityField.TEXT_4));
         task.setText(5, row.getString(ActivityField.TEXT_5));
         task.setText(6, row.getString(ActivityField.TEXT_6));
         task.setText(7, row.getString(ActivityField.TEXT_7));
         task.setText(8, row.getString(ActivityField.TEXT_8));
         task.setText(9, row.getString(ActivityField.TEXT_9));
         task.setText(10, row.getString(ActivityField.TEXT_10));
         task.setText(11, row.getString(ActivityField.TEXT_11));
         task.setText(12, row.getString(ActivityField.TEXT_12));
         task.setText(13, row.getString(ActivityField.TEXT_13));
         task.setText(14, row.getString(ActivityField.TEXT_14));
         task.setText(15, row.getString(ActivityField.TEXT_15));
         task.setText(16, row.getString(ActivityField.TEXT_16));
         task.setText(17, row.getString(ActivityField.TEXT_17));
         task.setText(18, row.getString(ActivityField.TEXT_18));
         task.setText(19, row.getString(ActivityField.TEXT_19));
         task.setText(20, row.getString(ActivityField.TEXT_20));
         task.setText(21, row.getString(ActivityField.TEXT_21));
         task.setText(22, row.getString(ActivityField.TEXT_22));
         task.setText(23, row.getString(ActivityField.TEXT_23));
         task.setText(24, row.getString(ActivityField.TEXT_24));
         task.setText(25, row.getString(ActivityField.TEXT_25));
         task.setText(26, row.getString(ActivityField.TEXT_26));
         task.setText(27, row.getString(ActivityField.TEXT_27));
         task.setText(28, row.getString(ActivityField.TEXT_28));
         task.setText(29, row.getString(ActivityField.TEXT_29));
         task.setText(30, row.getString(ActivityField.TEXT_30));

         task.setWBS(row.getString(ActivityField.WBS));
         task.setGUID(row.getUUID(ActivityField._ACTIVITY_GUID));
         task.setOutlineLevel(getOutlineLevel(task));
         m_eventManager.fireTaskReadEvent(task);
      }

      FastTrackTable table = m_data.getTable(FastTrackTableType.ACTBARS);
      Set<Task> tasksWithBars = new HashSet<Task>();

      for (MapRow row : table)
      {
         if (row.getInt(ActBarField.BAR_ID) < 1)
         {
            continue;
         }

         Task task = m_project.getTaskByUniqueID(row.getInteger(ActBarField._ACTIVITY));
         if (task == null || tasksWithBars.contains(task))
         {
            continue;
         }
         tasksWithBars.add(task);

         // % Used
         task.setActualDuration(row.getDuration(ActBarField.ACTUAL_DURATION));
         task.setActualFinish(row.getTimestamp(ActBarField.ACTUAL_FINISH_DATE, ActBarField.ACTUAL_FINISH_TIME));
         task.setActualStart(row.getTimestamp(ActBarField.ACTUAL_START_DATE, ActBarField.ACTUAL_START_TIME));
         // Attendees
         task.setBaselineCost(1, row.getCurrency(ActBarField.BASELINE_COST_1));
         task.setBaselineCost(2, row.getCurrency(ActBarField.BASELINE_COST_2));
         task.setBaselineCost(3, row.getCurrency(ActBarField.BASELINE_COST_3));
         task.setBaselineCost(4, row.getCurrency(ActBarField.BASELINE_COST_4));
         task.setBaselineCost(5, row.getCurrency(ActBarField.BASELINE_COST_5));
         task.setBaselineCost(6, row.getCurrency(ActBarField.BASELINE_COST_6));
         task.setBaselineCost(7, row.getCurrency(ActBarField.BASELINE_COST_7));
         task.setBaselineCost(8, row.getCurrency(ActBarField.BASELINE_COST_8));
         task.setBaselineCost(9, row.getCurrency(ActBarField.BASELINE_COST_9));
         task.setBaselineCost(10, row.getCurrency(ActBarField.BASELINE_COST_10));
         task.setBaselineDuration(1, row.getDuration(ActBarField.BASELINE_DURATION_1));
         task.setBaselineDuration(2, row.getDuration(ActBarField.BASELINE_DURATION_2));
         task.setBaselineDuration(3, row.getDuration(ActBarField.BASELINE_DURATION_3));
         task.setBaselineDuration(4, row.getDuration(ActBarField.BASELINE_DURATION_4));
         task.setBaselineDuration(5, row.getDuration(ActBarField.BASELINE_DURATION_5));
         task.setBaselineDuration(6, row.getDuration(ActBarField.BASELINE_DURATION_6));
         task.setBaselineDuration(7, row.getDuration(ActBarField.BASELINE_DURATION_7));
         task.setBaselineDuration(8, row.getDuration(ActBarField.BASELINE_DURATION_8));
         task.setBaselineDuration(9, row.getDuration(ActBarField.BASELINE_DURATION_9));
         task.setBaselineDuration(10, row.getDuration(ActBarField.BASELINE_DURATION_10));
         task.setBaselineFinish(1, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_1, ActBarField.BASELINE_FINISH_TIME_1));
         task.setBaselineFinish(2, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_2, ActBarField.BASELINE_FINISH_TIME_2));
         task.setBaselineFinish(3, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_3, ActBarField.BASELINE_FINISH_TIME_3));
         task.setBaselineFinish(4, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_4, ActBarField.BASELINE_FINISH_TIME_4));
         task.setBaselineFinish(5, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_5, ActBarField.BASELINE_FINISH_TIME_5));
         task.setBaselineFinish(6, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_6, ActBarField.BASELINE_FINISH_TIME_6));
         task.setBaselineFinish(7, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_7, ActBarField.BASELINE_FINISH_TIME_7));
         task.setBaselineFinish(8, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_8, ActBarField.BASELINE_FINISH_TIME_8));
         task.setBaselineFinish(9, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_9, ActBarField.BASELINE_FINISH_TIME_9));
         task.setBaselineFinish(10, row.getTimestamp(ActBarField.BASELINE_FINISH_DATE_10, ActBarField.BASELINE_FINISH_TIME_10));
         task.setBaselineFinish(1, row.getTimestamp(ActBarField.BASELINE_START_DATE_1, ActBarField.BASELINE_START_TIME_1));
         task.setBaselineFinish(2, row.getTimestamp(ActBarField.BASELINE_START_DATE_2, ActBarField.BASELINE_START_TIME_2));
         task.setBaselineFinish(3, row.getTimestamp(ActBarField.BASELINE_START_DATE_3, ActBarField.BASELINE_START_TIME_3));
         task.setBaselineFinish(4, row.getTimestamp(ActBarField.BASELINE_START_DATE_4, ActBarField.BASELINE_START_TIME_4));
         task.setBaselineFinish(5, row.getTimestamp(ActBarField.BASELINE_START_DATE_5, ActBarField.BASELINE_START_TIME_5));
         task.setBaselineFinish(6, row.getTimestamp(ActBarField.BASELINE_START_DATE_6, ActBarField.BASELINE_START_TIME_6));
         task.setBaselineFinish(7, row.getTimestamp(ActBarField.BASELINE_START_DATE_7, ActBarField.BASELINE_START_TIME_7));
         task.setBaselineFinish(8, row.getTimestamp(ActBarField.BASELINE_START_DATE_8, ActBarField.BASELINE_START_TIME_8));
         task.setBaselineFinish(9, row.getTimestamp(ActBarField.BASELINE_START_DATE_9, ActBarField.BASELINE_START_TIME_9));
         task.setBaselineFinish(10, row.getTimestamp(ActBarField.BASELINE_START_DATE_10, ActBarField.BASELINE_START_TIME_10));
         task.setBaselineWork(1, row.getWork(ActBarField.BASELINE_WORK_1));
         task.setBaselineWork(2, row.getWork(ActBarField.BASELINE_WORK_2));
         task.setBaselineWork(3, row.getWork(ActBarField.BASELINE_WORK_3));
         task.setBaselineWork(4, row.getWork(ActBarField.BASELINE_WORK_4));
         task.setBaselineWork(5, row.getWork(ActBarField.BASELINE_WORK_5));
         task.setBaselineWork(6, row.getWork(ActBarField.BASELINE_WORK_6));
         task.setBaselineWork(7, row.getWork(ActBarField.BASELINE_WORK_7));
         task.setBaselineWork(8, row.getWork(ActBarField.BASELINE_WORK_8));
         task.setBaselineWork(9, row.getWork(ActBarField.BASELINE_WORK_9));
         task.setBaselineWork(10, row.getWork(ActBarField.BASELINE_WORK_10));
         task.setConstraintDate(row.getTimestamp(ActBarField.CONSTRAINT_DATE, ActBarField.CONSTRAINT_TIME));
         task.setCost(1, row.getCurrency(ActBarField.COST_1));
         task.setCost(2, row.getCurrency(ActBarField.COST_2));
         task.setCost(3, row.getCurrency(ActBarField.COST_3));
         task.setCost(4, row.getCurrency(ActBarField.COST_4));
         task.setCost(5, row.getCurrency(ActBarField.COST_5));
         task.setCost(6, row.getCurrency(ActBarField.COST_6));
         task.setCost(7, row.getCurrency(ActBarField.COST_7));
         task.setCost(8, row.getCurrency(ActBarField.COST_8));
         task.setCost(9, row.getCurrency(ActBarField.COST_9));
         task.setCost(10, row.getCurrency(ActBarField.COST_10));
         // Created
         task.setCritical(row.getBoolean(ActBarField.CRITICAL));
         task.setDate(1, row.getDate(ActBarField.DATE_1));
         task.setDate(2, row.getDate(ActBarField.DATE_2));
         task.setDate(3, row.getDate(ActBarField.DATE_3));
         task.setDate(4, row.getDate(ActBarField.DATE_4));
         task.setDate(5, row.getDate(ActBarField.DATE_5));
         task.setDate(6, row.getDate(ActBarField.DATE_6));
         task.setDate(7, row.getDate(ActBarField.DATE_7));
         task.setDate(8, row.getDate(ActBarField.DATE_8));
         task.setDate(9, row.getDate(ActBarField.DATE_9));
         task.setDate(10, row.getDate(ActBarField.DATE_10));
         task.setDuration(row.getDuration(ActBarField.DURATION));
         task.setDuration(1, row.getDuration(ActBarField.DURATION_1));
         task.setDuration(2, row.getDuration(ActBarField.DURATION_2));
         task.setDuration(3, row.getDuration(ActBarField.DURATION_3));
         task.setDuration(4, row.getDuration(ActBarField.DURATION_4));
         task.setDuration(5, row.getDuration(ActBarField.DURATION_5));
         task.setDuration(6, row.getDuration(ActBarField.DURATION_6));
         task.setDuration(7, row.getDuration(ActBarField.DURATION_7));
         task.setDuration(8, row.getDuration(ActBarField.DURATION_8));
         task.setDuration(9, row.getDuration(ActBarField.DURATION_9));
         task.setDuration(10, row.getDuration(ActBarField.DURATION_10));
         task.setEarlyFinish(row.getTimestamp(ActBarField.EARLY_FINISH_DATE, ActBarField.EARLY_FINISH_TIME));
         task.setEarlyStart(row.getTimestamp(ActBarField.EARLY_START_DATE, ActBarField.EARLY_START_TIME));
         task.setEffortDriven(row.getBoolean(ActBarField.EFFORT_DRIVEN));
         task.setFinish(row.getTimestamp(ActBarField.FINISH_DATE, ActBarField.FINISH_TIME));
         task.setFinish(1, row.getTimestamp(ActBarField.FINISH_DATE_1, ActBarField.FINISH_TIME_1));
         task.setFinish(2, row.getTimestamp(ActBarField.FINISH_DATE_2, ActBarField.FINISH_TIME_2));
         task.setFinish(3, row.getTimestamp(ActBarField.FINISH_DATE_3, ActBarField.FINISH_TIME_3));
         task.setFinish(4, row.getTimestamp(ActBarField.FINISH_DATE_4, ActBarField.FINISH_TIME_4));
         task.setFinish(5, row.getTimestamp(ActBarField.FINISH_DATE_5, ActBarField.FINISH_TIME_5));
         task.setFinish(6, row.getTimestamp(ActBarField.FINISH_DATE_6, ActBarField.FINISH_TIME_6));
         task.setFinish(7, row.getTimestamp(ActBarField.FINISH_DATE_7, ActBarField.FINISH_TIME_7));
         task.setFinish(8, row.getTimestamp(ActBarField.FINISH_DATE_8, ActBarField.FINISH_TIME_8));
         task.setFinish(9, row.getTimestamp(ActBarField.FINISH_DATE_9, ActBarField.FINISH_TIME_9));
         task.setFinish(10, row.getTimestamp(ActBarField.FINISH_DATE_10, ActBarField.FINISH_TIME_10));
         // Finish Slack
         // Fixed Cost
         // Fixed Duration
         // Free Float
         task.setIgnoreResourceCalendar(row.getBoolean(ActBarField.IGNORE_RESOURCE_CALENDARS));
         task.setLateFinish(row.getTimestamp(ActBarField.LATE_FINISH_DATE, ActBarField.LATE_FINISH_TIME));
         task.setLateStart(row.getTimestamp(ActBarField.LATE_START_DATE, ActBarField.LATE_START_TIME));
         task.setNumber(1, row.getDouble(ActBarField.NUMBER_1));
         task.setNumber(2, row.getDouble(ActBarField.NUMBER_2));
         task.setNumber(3, row.getDouble(ActBarField.NUMBER_3));
         task.setNumber(4, row.getDouble(ActBarField.NUMBER_4));
         task.setNumber(5, row.getDouble(ActBarField.NUMBER_5));
         task.setNumber(6, row.getDouble(ActBarField.NUMBER_6));
         task.setNumber(7, row.getDouble(ActBarField.NUMBER_7));
         task.setNumber(8, row.getDouble(ActBarField.NUMBER_8));
         task.setNumber(9, row.getDouble(ActBarField.NUMBER_9));
         task.setNumber(10, row.getDouble(ActBarField.NUMBER_10));
         task.setNumber(11, row.getDouble(ActBarField.NUMBER_11));
         task.setNumber(12, row.getDouble(ActBarField.NUMBER_12));
         task.setNumber(13, row.getDouble(ActBarField.NUMBER_13));
         task.setNumber(14, row.getDouble(ActBarField.NUMBER_14));
         task.setNumber(15, row.getDouble(ActBarField.NUMBER_15));
         task.setNumber(16, row.getDouble(ActBarField.NUMBER_16));
         task.setNumber(17, row.getDouble(ActBarField.NUMBER_17));
         task.setNumber(18, row.getDouble(ActBarField.NUMBER_18));
         task.setNumber(19, row.getDouble(ActBarField.NUMBER_19));
         task.setNumber(20, row.getDouble(ActBarField.NUMBER_20));
         task.setPercentageComplete(row.getDouble(ActBarField.PERCENT_COMPLETE));
         // Priority
         // Resource Cost
         task.setResourceNames(row.getString(ActBarField.RESOURCES_ASSIGNED));
         // Revised Duration
         // Revised Finish Date
         // Revised Finish Time
         // Revised Start Date
         // Revised Start Time
         task.setStart(row.getTimestamp(ActBarField.START_DATE, ActBarField.START_TIME));
         // Start Float
         task.setStart(1, row.getTimestamp(ActBarField.START_DATE_1, ActBarField.START_TIME_1));
         task.setStart(2, row.getTimestamp(ActBarField.START_DATE_2, ActBarField.START_TIME_2));
         task.setStart(3, row.getTimestamp(ActBarField.START_DATE_3, ActBarField.START_TIME_3));
         task.setStart(4, row.getTimestamp(ActBarField.START_DATE_4, ActBarField.START_TIME_4));
         task.setStart(5, row.getTimestamp(ActBarField.START_DATE_5, ActBarField.START_TIME_5));
         task.setStart(6, row.getTimestamp(ActBarField.START_DATE_6, ActBarField.START_TIME_6));
         task.setStart(7, row.getTimestamp(ActBarField.START_DATE_7, ActBarField.START_TIME_7));
         task.setStart(8, row.getTimestamp(ActBarField.START_DATE_8, ActBarField.START_TIME_8));
         task.setStart(9, row.getTimestamp(ActBarField.START_DATE_9, ActBarField.START_TIME_9));
         task.setStart(10, row.getTimestamp(ActBarField.START_DATE_10, ActBarField.START_TIME_10));
         // Task Calendar
         // Total Cost
         // Total Float
         // Total Resource Duration
         task.setWork(row.getWork(ActBarField.WORK));
         // _Activity
         // _BarBits
         // _BarStl
         // _yOffset
      }

      m_project.updateStructure();
   }
860476
public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo) {
    List<String> diagHistory = taskDiagnosticData.get(taskId);
    if (diagHistory == null) {
      diagHistory = new ArrayList<String>();
      taskDiagnosticData.put(taskId, diagHistory);
    }
    diagHistory.add(diagInfo);
  }
60097
public final void registerStatus(TaskStatus status) {
	TaskStatus.validate(this.status, status);
	this.status = status;
	if (status.equals(TaskStatus.SUBMITTED)) {
	  clear();
	}
  }
33258
private void taskComplete(
      HttpRemoteTaskRunnerWorkItem taskRunnerWorkItem,
      WorkerHolder workerHolder,
      TaskStatus taskStatus
  )
  {
    Preconditions.checkState(!Thread.holdsLock(statusLock), "Current thread must not hold statusLock.");
    Preconditions.checkNotNull(taskRunnerWorkItem, "taskRunnerWorkItem");
    Preconditions.checkNotNull(taskStatus, "taskStatus");
    if (workerHolder != null) {
      log.info(
          "Worker[%s] completed task[%s] with status[%s]",
          workerHolder.getWorker().getHost(),
          taskStatus.getId(),
          taskStatus.getStatusCode()
      );
      // Worker is done with this task
      workerHolder.setLastCompletedTaskTime(DateTimes.nowUtc());
    }

    // Notify interested parties
    taskRunnerWorkItem.setResult(taskStatus);
    TaskRunnerUtils.notifyStatusChanged(listeners, taskStatus.getId(), taskStatus);

    // Update success/failure counters, Blacklist node if there are too many failures.
    if (workerHolder != null) {
      blacklistWorkerIfNeeded(taskStatus, workerHolder);
    }

    synchronized (statusLock) {
      statusLock.notifyAll();
    }
  }
629765
public void updateTask(TaskResult taskResult) {
        Preconditions.checkNotNull(taskResult, "Task result cannot be null");
        stub.updateTask(TaskServicePb.UpdateTaskRequest.newBuilder()
                .setResult(protoMapper.toProto(taskResult))
                .build()
        );
    }
132795
public void setTasks(java.util.Collection<AuditTaskMetadata> tasks) {
        if (tasks == null) {
            this.tasks = null;
            return;
        }

        this.tasks = new java.util.ArrayList<AuditTaskMetadata>(tasks);
    }
491518
public function updateTaskStatus($taskId, $status)
    {
        if ($this->getPersistence()->has($taskId)) {
            $this->getPersistence()->update($taskId , $status);
        }
        return $this;
    }
996951
public void updateUniqueCounters()
   {
      //
      // Update task unique IDs
      //
      for (Task task : m_parent.getTasks())
      {
         int uniqueID = NumberHelper.getInt(task.getUniqueID());
         if (uniqueID > m_taskUniqueID)
         {
            m_taskUniqueID = uniqueID;
         }
      }

      //
      // Update resource unique IDs
      //
      for (Resource resource : m_parent.getResources())
      {
         int uniqueID = NumberHelper.getInt(resource.getUniqueID());
         if (uniqueID > m_resourceUniqueID)
         {
            m_resourceUniqueID = uniqueID;
         }
      }

      //
      // Update calendar unique IDs
      //
      for (ProjectCalendar calendar : m_parent.getCalendars())
      {
         int uniqueID = NumberHelper.getInt(calendar.getUniqueID());
         if (uniqueID > m_calendarUniqueID)
         {
            m_calendarUniqueID = uniqueID;
         }
      }

      //
      // Update assignment unique IDs
      //
      for (ResourceAssignment assignment : m_parent.getResourceAssignments())
      {
         int uniqueID = NumberHelper.getInt(assignment.getUniqueID());
         if (uniqueID > m_assignmentUniqueID)
         {
            m_assignmentUniqueID = uniqueID;
         }
      }
   }
5105
private void sendUpdatePartitionInfoRpcCall(
			final Iterable<PartitionInfo> partitionInfos) {

		final LogicalSlot slot = assignedResource;

		if (slot != null) {
			final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway();
			final TaskManagerLocation taskManagerLocation = slot.getTaskManagerLocation();

			CompletableFuture<Acknowledge> updatePartitionsResultFuture = taskManagerGateway.updatePartitions(attemptId, partitionInfos, rpcTimeout);

			updatePartitionsResultFuture.whenCompleteAsync(
				(ack, failure) -> {
					// fail if there was a failure
					if (failure != null) {
						fail(new IllegalStateException("Update task on TaskManager " + taskManagerLocation +
							" failed due to:", failure));
					}
				}, getVertex().getExecutionGraph().getJobMasterMainThreadExecutor());
		}
	}
425359
public synchronized void updateTaskStatus(TaskInProgress tip,
                                            TaskStatus status) {

    double oldProgress = tip.getProgress();   // save old progress
    boolean wasRunning = tip.isRunning();
    boolean wasComplete = tip.isComplete();
    boolean wasPending = tip.isOnlyCommitPending();
    TaskAttemptID taskid = status.getTaskID();
    boolean wasAttemptRunning = tip.isAttemptRunning(taskid);

    // If the TIP is already completed and the task reports as SUCCEEDED then
    // mark the task as KILLED.
    // In case of task with no promotion the task tracker will mark the task
    // as SUCCEEDED.
    // User has requested to kill the task, but TT reported SUCCEEDED,
    // mark the task KILLED.
    if ((wasComplete || tip.wasKilled(taskid)) &&
        (status.getRunState() == TaskStatus.State.SUCCEEDED)) {
      status.setRunState(TaskStatus.State.KILLED);
    }

    // When a task has just reported its state as FAILED_UNCLEAN/KILLED_UNCLEAN,
    // if the job is complete or cleanup task is switched off,
    // make the task's state FAILED/KILLED without launching cleanup attempt.
    // Note that if task is already a cleanup attempt,
    // we don't change the state to make sure the task gets a killTaskAction
    if ((this.isComplete() || jobFailed || jobKilled || !taskCleanupNeeded) &&
        !tip.isCleanupAttempt(taskid)) {
      if (status.getRunState() == TaskStatus.State.FAILED_UNCLEAN) {
        status.setRunState(TaskStatus.State.FAILED);
      } else if (status.getRunState() == TaskStatus.State.KILLED_UNCLEAN) {
        status.setRunState(TaskStatus.State.KILLED);
      }
    }

    boolean change = tip.updateStatus(status);
    if (change) {
      TaskStatus.State state = status.getRunState();
      // get the TaskTrackerStatus where the task ran
      TaskTracker taskTracker =
        this.jobtracker.getTaskTracker(tip.machineWhereTaskRan(taskid));
      TaskTrackerStatus ttStatus =
        (taskTracker == null) ? null : taskTracker.getStatus();
      String httpTaskLogLocation = null;

      if (null != ttStatus){
        String host;
        if (NetUtils.getStaticResolution(ttStatus.getHost()) != null) {
          host = NetUtils.getStaticResolution(ttStatus.getHost());
        } else {
          host = ttStatus.getHost();
        }
        httpTaskLogLocation = "http://" + host + ":" + ttStatus.getHttpPort();
           //+ "/tasklog?plaintext=true&taskid=" + status.getTaskID();
      }

      TaskCompletionEvent taskEvent = null;
      if (state == TaskStatus.State.SUCCEEDED) {
        TaskCompletionEvent.Status taskCompletionStatus = TaskCompletionEvent.Status.SUCCEEDED;
        // Ensure that this is a map task.
        boolean isMapTask = status.getIsMap() && !tip.isJobCleanupTask() && !tip.isJobSetupTask();
        if (enableNoFetchEmptyMapOutputs && isMapTask) {
          long outBytes = status.getCounters().getCounter(Task.Counter.MAP_OUTPUT_BYTES);
          if (outBytes == 0) {
            taskCompletionStatus = TaskCompletionEvent.Status.SUCCEEDED_NO_OUTPUT;
          }
        }
        taskEvent = new TaskCompletionEvent(
                                            taskCompletionEventTracker,
                                            taskid,
                                            tip.idWithinJob(),
                                            isMapTask,
                                            taskCompletionStatus,
                                            httpTaskLogLocation
                                           );
        taskEvent.setTaskRunTime((int)(status.getFinishTime()
                                       - status.getStartTime()));
        tip.setSuccessEventNumber(taskCompletionEventTracker);
      } else if (state == TaskStatus.State.COMMIT_PENDING) {
        // If it is the first attempt reporting COMMIT_PENDING
        // ask the task to commit.
        if (!wasComplete && !wasPending) {
          tip.doCommit(taskid);
        }
        return;
      } else if (state == TaskStatus.State.FAILED_UNCLEAN ||
                 state == TaskStatus.State.KILLED_UNCLEAN) {
        tip.incompleteSubTask(taskid, this.status);
        // add this task, to be rescheduled as cleanup attempt
        if (tip.isMapTask()) {
          mapCleanupTasks.add(taskid);
        } else {
          reduceCleanupTasks.add(taskid);
        }
        // Remove the task entry from jobtracker
        jobtracker.removeTaskEntry(taskid);
      }
      //For a failed task update the JT datastructures.
      else if (state == TaskStatus.State.FAILED ||
               state == TaskStatus.State.KILLED) {
        // Get the event number for the (possibly) previously successful
        // task. If there exists one, then set that status to OBSOLETE
        int eventNumber;
        if ((eventNumber = tip.getSuccessEventNumber()) != -1) {
          TaskCompletionEvent t =
            this.taskCompletionEvents.get(eventNumber);
          if (t.getTaskAttemptId().equals(taskid))
            t.setTaskStatus(TaskCompletionEvent.Status.OBSOLETE);
        }

        // Tell the job to fail the relevant task
        failedTask(tip, taskid, status, taskTracker,
                   wasRunning, wasComplete, wasAttemptRunning);

        // Did the task failure lead to tip failure?
        TaskCompletionEvent.Status taskCompletionStatus =
          (state == TaskStatus.State.FAILED ) ?
              TaskCompletionEvent.Status.FAILED :
              TaskCompletionEvent.Status.KILLED;
        if (tip.isFailed()) {
          taskCompletionStatus = TaskCompletionEvent.Status.TIPFAILED;
        }
        taskEvent = new TaskCompletionEvent(taskCompletionEventTracker,
                                            taskid,
                                            tip.idWithinJob(),
                                            status.getIsMap() &&
                                            !tip.isJobCleanupTask() &&
                                            !tip.isJobSetupTask(),
                                            taskCompletionStatus,
                                            httpTaskLogLocation
                                           );
      }

      // Add the 'complete' task i.e. successful/failed
      // It _is_ safe to add the TaskCompletionEvent.Status.SUCCEEDED
      // *before* calling TIP.completedTask since:
      // a. One and only one task of a TIP is declared as a SUCCESS, the
      //    other (speculative tasks) are marked KILLED by the TaskCommitThread
      // b. TIP.completedTask *does not* throw _any_ exception at all.
      if (taskEvent != null) {
        this.taskCompletionEvents.add(taskEvent);
        taskCompletionEventTracker++;
        JobTrackerStatistics.TaskTrackerStat ttStat = jobtracker.
           getStatistics().getTaskTrackerStat(tip.machineWhereTaskRan(taskid));
        if(ttStat != null) { // ttStat can be null in case of lost tracker
          ttStat.incrTotalTasks();
        }
        if (state == TaskStatus.State.SUCCEEDED) {
          completedTask(tip, status);
          if(ttStat != null) {
            ttStat.incrSucceededTasks();
          }
        }
        countersLog.info(status.getTaskID() + " completion counters "
            + status.getCounters().makeJsonString());
      }
    }

    //
    // Update JobInProgress status
    //
    if(LOG.isDebugEnabled()) {
      LOG.debug("Taking progress for " + tip.getTIPId() + " from " +
                 oldProgress + " to " + tip.getProgress());
    }

    if (!tip.isJobCleanupTask() && !tip.isJobSetupTask()) {
      double progressDelta = tip.getProgress() - oldProgress;
      if (tip.isMapTask()) {
          this.status.setMapProgress((float) (this.status.mapProgress() +
                                              progressDelta / maps.length));
      } else {
        this.status.setReduceProgress((float) (this.status.reduceProgress() +
                                           (progressDelta / reduces.length)));
      }
    }
  }
1004268
def WaitForTasks(tasks,
                 raiseOnError=True,
                 si=None,
                 pc=None,
                 onProgressUpdate=None,
                 results=None):
    

    if not tasks:
        return

    if si is None:
        si = vim.ServiceInstance("ServiceInstance", tasks[0]._stub)
    if pc is None:
        pc = si.content.propertyCollector
    if results is None:
        results = []

    progressUpdaters = {}
    for task in tasks:
        progressUpdater = ProgressUpdater(task, onProgressUpdate)
        progressUpdater.Update('created')
        progressUpdaters[str(task)] = progressUpdater

    filter = CreateTasksFilter(pc, tasks)

    try:
        version, state = None, None

        # Loop looking for updates till the state moves to a completed state.
        while len(progressUpdaters):
            update = pc.WaitForUpdates(version)
            for filterSet in update.filterSet:
                for objSet in filterSet.objectSet:
                    task = objSet.obj
                    taskId = str(task)
                    for change in objSet.changeSet:
                        if change.name == 'info':
                            state = change.val.state
                        elif change.name == 'info.state':
                            state = change.val
                        else:
                            continue

                        progressUpdater = progressUpdaters.get(taskId)
                        if not progressUpdater:
                            continue

                        if state == vim.TaskInfo.State.success:
                            progressUpdater.Update('completed')
                            progressUpdaters.pop(taskId)
                            # cache the results, as task objects could expire if one
                            # of the tasks take a longer time to complete
                            results.append(task.info.result)
                        elif state == vim.TaskInfo.State.error:
                            err = task.info.error
                            progressUpdater.Update('error: %s' % str(err))
                            if raiseOnError:
                                raise err
                            else:
                                print("Task %s reported error: %s" % (taskId, str(err)))
                                progressUpdaters.pop(taskId)
                        else:
                            if onProgressUpdate:
                                progressUpdater.UpdateIfNeeded()
            # Move to next version
            version = update.version
    finally:
        if filter:
            filter.Destroy()
    return
819862
def add_task_status(self, name, **attrs):
        
        return TaskStatuses(self.requester).create(self.id, name, **attrs)
521088
private void postProcessTasks()
   {
      List<Task> allTasks = m_file.getTasks();
      if (allTasks.size() > 1)
      {
         Collections.sort(allTasks);

         int taskID = -1;
         int lastTaskID = -1;

         for (int i = 0; i < allTasks.size(); i++)
         {
            Task task = allTasks.get(i);
            taskID = NumberHelper.getInt(task.getID());
            // In Project the tasks IDs are always contiguous so we can spot invalid tasks by making sure all
            // IDs are represented.
            if (!task.getNull() && lastTaskID != -1 && taskID > lastTaskID + 1)
            {
               // This task looks to be invalid.
               task.setNull(true);
            }
            else
            {
               lastTaskID = taskID;
            }
         }
      }
   }