Adds a failed TIP in the front of the list for non-running reduces
@param tip the tip that needs to be failed
326987
private synchronized void failReduce(TaskInProgress tip) {
    if (nonRunningReduces == null) {
      LOG.warn("Failed cache for reducers missing!! "
               + "Job details are missing.");
      return;
    }
    nonRunningReduces.add(0, tip);
  }
1305609
public void writeFailedResult(int line, String value) {
        logger.debug("Write Failed result => line:{} value:{}", line, value);
        writeValue(resultColumnName, line, value);
    }
736299
public void add(final ConfigItem item)
	{
		failed = failed || item.getType() == ConfigItemTypes.ERROR;
		this.list.add(item);
	}
1197317
@Override
  public void run() {
    while (true) {
      // Wait to get a TIP
      TipToFinish ttf = null;
      try {
        LOG.debug("Waiting for a TIP");
        ttf = tipQueue.take();
      } catch (InterruptedException e) {
        LOG.info("Got interrupted exception while waiting to take()");
        continue;
      }
      LOG.debug(" Got a TIP " + ttf.getTip().getTask().getTaskID() +
          " at time " + System.currentTimeMillis() + " with finish time " +
          ttf.getTimeToFinish());
      // Wait until it's time to finish the task. Since the TIP was pulled from
      // the priority queue, this should be the first task in the queue that
      // needs to be finished. If we get interrupted, that means that it's
      // possible that we added a TIP that should finish earlier
      boolean interrupted = false;
      while (true) {
        long currentTime = System.currentTimeMillis();
        if (currentTime < ttf.getTimeToFinish()) {
          try {
            long sleepTime = ttf.getTimeToFinish() - currentTime;
            LOG.debug("Sleeping for " + sleepTime + " ms");
            Thread.sleep(sleepTime);
          } catch (InterruptedException e) {
            LOG.debug("Finisher thread was interrupted", e);
            interrupted = true;
            break;
          }
        } else {
          break;
        }
      }

      // Wait was interrupted, then it could mean that we added a task
      // that needs to finish sooner. Put that task back and start again
      if (interrupted) {
        LOG.info("Putting back TIP " + ttf.getTip().getTask().getTaskID() +
            " for job " + ttf.getTip().getTask().getJobID());
        tipQueue.put(ttf);
        continue;
      }

      // Finish the task
      TaskInProgress tip = ttf.getTip();
      ttf.finishTip();

      // Also clean up the mapper wait thread map for reducers. It should exist
      // for reduce tasks that are not cleanup tasks
      if (!tip.getTask().isMapTask() &&
          !tip.getTask().isTaskCleanupTask() &&
          !tip.getTask().isJobCleanupTask() &&
          !tip.getTask().isJobSetupTask()) {
        if (!mapperWaitThreadMap.containsKey(tip)) {
          throw new RuntimeException("Unable to find mapper wait thread for " +
              tip.getTask().getTaskID() + " job " + tip.getTask().getJobID());
        }
        LOG.debug("Removing mapper wait thread for " +
            tip.getTask().getTaskID() + " job " + tip.getTask().getJobID());
        mapperWaitThreadMap.remove(tip);
      } else if (mapperWaitThreadMap.containsKey(tip)) {
        throw new RuntimeException("Mapper wait thread exists for" +
            tip.getTask().getTaskID() + " job " + tip.getTask().getJobID() +
            " when it shouldn't!");
      }
    }
  }
77700
public void setErrorText(FailedTaskReport failedTaskReport) {
		Point p = this.scrollPaneText.getViewport().getViewPosition();
		
		final String failedTaskReportString = failedTaskReport == null ? 
				"Failed Task Report is null" : failedTaskReport.toString();

		SwingUtilities.invokeLater(
			new Runnable(){
				public void run(){
					if(!scrollPaneText.isVisible())
					{
						topWrapper.remove(scrollPaneTable);
						scrollPaneTable.setVisible(false);
						topWrapper.add(scrollPaneText, BorderLayout.CENTER);
						scrollPaneText.setVisible(true);
						topWrapper.validate();
					}
					errorTextField.setText(failedTaskReportString);
					errorTextField.repaint();
				}
			}
		);

		this.scrollPaneText.getViewport().setViewPosition(p);
		this.exportButton.setEnabled(failedTaskReport != null);
	}
332968
void reportFailedCheckpoint(long failureTimestamp, @Nullable Throwable cause) {
		FailedCheckpointStats failed = new FailedCheckpointStats(
			checkpointId,
			triggerTimestamp,
			props,
			numberOfSubtasks,
			new HashMap<>(taskStats),
			currentNumAcknowledgedSubtasks,
			currentStateSize,
			currentAlignmentBuffered,
			failureTimestamp,
			latestAcknowledgedSubtask,
			cause);

		trackerCallback.reportFailedCheckpoint(failed);
	}
135325
@SuppressWarnings("deprecation")
  private void meterTaskAttemptUnprotected(TaskInProgress tip, TaskStatus status) {
    Counter slotCounter =
      (tip.isMapTask()) ? Counter.SLOTS_MILLIS_MAPS :
                          Counter.SLOTS_MILLIS_REDUCES;
    jobCounters.incrCounter(slotCounter,
                            tip.getNumSlotsRequired() *
                            (status.getFinishTime() - status.getStartTime()));
    if (!tip.isMapTask()) {
      jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_COPY,
                  tip.getNumSlotsRequired() *
                  (status.getShuffleFinishTime() - status.getStartTime()));
      jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_SORT,
                  tip.getNumSlotsRequired() *
                  (status.getSortFinishTime() - status.getShuffleFinishTime()));
      jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_REDUCE,
                  tip.getNumSlotsRequired() *
                  (status.getFinishTime() - status.getSortFinishTime()));
    }
  }
629768
private void reportFailedCheckpoint(FailedCheckpointStats failed) {
		statsReadWriteLock.lock();
		try {
			counts.incrementFailedCheckpoints();
			history.replacePendingCheckpointById(failed);

			dirty = true;
		} finally {
			statsReadWriteLock.unlock();
		}
	}
3890
public static void install(Node node, JFXTooltip tooltip, Pos pos) {
        tooltip.setPos(pos);
        BEHAVIOR.install(node, tooltip);
    }
234186
@SuppressWarnings("FutureReturnValueIgnored")
  private void failWrites(Throwable cause) {
    if (failCause == null) {
      failCause = cause;
    } else {
      logger.log(Level.FINE, "Ignoring duplicate failure", cause);
    }
    while (!bufferedWrites.isEmpty()) {
      ChannelWrite write = bufferedWrites.poll();
      write.promise.setFailure(cause);
      ReferenceCountUtil.release(write.msg);
    }
  }
656899
def _add_tip_during_transfer(self, tips, **kwargs):
        
        if self.has_tip_rack() and tips > 0 and not self.current_tip():
            self.pick_up_tip()
312670
function(ln, offset) {
  var s = ln.slice(offset);
  if (!(this.tip.open)) {
    throw({ msg: "Attempted to add line (" + ln + ") to closed container." });
  }
  this.tip.strings.push(s);
}
507025
public void setFailureReason(java.util.Collection<String> failureReason) {
        if (failureReason == null) {
            this.failureReason = null;
            return;
        }

        this.failureReason = new java.util.ArrayList<String>(failureReason);
    }
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)));
      }
    }
  }
633370
private void addPosition(final GraphObjectMap item, final Hint hint, final int cursorLine, final int replaceFrom, final int replaceTo) {

		final GraphObjectMap fromObject = new GraphObjectMap();
		final GraphObjectMap toObject   = new GraphObjectMap();

		fromObject.put(line, cursorLine);
		fromObject.put(ch, replaceFrom);

		toObject.put(line, cursorLine);
		toObject.put(ch, replaceTo);

		item.put(from, fromObject);
		item.put(to, toObject);
	}
1053782
private void retireReduceUnprotected(TaskInProgress tip) {
    if (runningReduces == null) {
      LOG.warn("Running list for reducers missing!! "
               + "Job details are missing.");
      return;
    }
    runningReduces.remove(tip);
  }
645944
function tip(title, content, actions, type) {
  if (curTip) {
    curTip.close(() => {
      setTimeout(() => {
        AppContainer.remove(topViewDialogKey);
        setTimeout(() => {
          creatTip(title, content, actions);
        }, 0);
      }, 200);
    });
  } else {
    creatTip(title, content, actions, type);
  }
}