Returns specified TaskInProgress, or null.
436479
public TaskInProgress getTip(TaskID tipid) {
    JobInProgressTraits job = getJobInProgress(tipid.getJobID());
    return (job == null ? null : job.getTaskInProgress(tipid));
  }
231387
private Throwable getResult(FutureTask<Throwable> task, Thread thread) {
        try {
            if (timeout > 0) {
                return task.get(timeout, timeUnit);
            } else {
                return task.get();
            }
        } catch (InterruptedException e) {
            return e; // caller will re-throw; no need to call Thread.interrupt()
        } catch (ExecutionException e) {
            // test failed; have caller re-throw the exception thrown by the test
            return e.getCause();
        } catch (TimeoutException e) {
            return createTimeoutException(thread);
        }
    }
197906
public String getTaskId() {
    Task task = getTask();
    return task != null ? task.getId() : null;
  }
303024
private Integer getOutlineLevel(Task task)
   {
      String value = task.getWBS();
      Integer result = Integer.valueOf(1);
      if (value != null && value.length() > 0)
      {
         String[] path = WBS_SPLIT_REGEX.split(value);
         result = Integer.valueOf(path.length);
      }
      return result;
   }
378134
private AuditUtilityTask getTask(String taskName) {
        AuditUtilityTask task = null;
        for (AuditUtilityTask availTask : tasks) {
            if (availTask.getTaskName().equals(taskName)) {
                task = availTask;
            }
        }
        return task;
    }
417581
public synchronized String getTaskStatus(final int taskId) throws NotFoundException {

    final TaskEntity running = getTask(taskId, runningTasks);
    if (running != null) {
      return "Running : " + running.toString();
    }

    final TaskEntity waiting = getTask(taskId, taskQueue);
    if (waiting != null) {
      return "Waiting : " + waiting.toString();
    }

    final TaskEntity finished = getTask(taskId, finishedTasks);
    if (finished != null) {
      return "Finished : " + finished.toString();
    }

    final TaskEntity canceled = getTask(taskId, canceledTasks);
    if (canceled != null) {
      return "Canceled: " + canceled.toString();
    }

    throw new NotFoundException(
        new StringBuilder().append("Task with ID ").append(taskId).append(" is not found").toString());
  }
1183455
Counters getTipCounters(TaskID tipid) {
    TaskInProgress tip = getTip(tipid);
    return (tip == null ? null : tip.getCounters());
  }
1287621
public double getProgressFromResponse(ResponseOnSingeRequest myResponse) {

        double progress = 0.0;
        try {

            if (myResponse == null || myResponse.isFailObtainResponse()) {
                return progress;
            }

            String responseBody = myResponse.getResponseBody();
            Pattern regex = Pattern.compile(progressRegex);
            Matcher matcher = regex.matcher(responseBody);
            if (matcher.matches()) {
                String progressStr = matcher.group(1);
                progress = Double.parseDouble(progressStr);
            }

        } catch (Exception t) {
            logger.error("fail " + t);

        }

        return progress;
    }
84841
public String getUserName(TaskAttemptID taskId) {
    TaskInProgress tip = tasks.get(taskId);
    if (tip != null) {
      return tip.getJobConf().getUser();
    }
    return null;
  }
444984
def GetProcessedTaskByIdentifier(self, task_identifier):
    
    with self._lock:
      task = self._tasks_processing.get(task_identifier, None)
      if not task:
        task = self._tasks_queued.get(task_identifier, None)
      if not task:
        task = self._tasks_abandoned.get(task_identifier, None)
      if not task:
        raise KeyError('Status of task {0:s} is unknown'.format(
            task_identifier))

    return task
1040612
function checkIfAnotherSessionInProgress() {
        var result = $.Deferred();
        if(updateJsonHandler) {
            var state = updateJsonHandler.state;

            updateJsonHandler.refresh()
                .done(function() {
                    var val = updateJsonHandler.get(updateProgressKey);
                    if(val !== null) {
                        result.resolve(val);
                    } else {
                        result.reject();
                    }
                })
                .fail(function() {
                    updateJsonHandler.state = state;
                    result.reject();
                });
        }
        return result.promise();
    }
998436
private static Stopwatch get(final Stopwatch parent, final String taskTitle) {
        if (taskTitle.equals(parent.getTaskTitle())) {
            return parent;
        }

        for (final Stopwatch leaf : parent.getLeaves()) {
            final Stopwatch ret = get(leaf, taskTitle);

            if (null != ret) {
                return ret;
            }
        }

        return null;
    }
1318676
protected void reportProgress(String taskDecription) {
        if (this.progress != null) {
            if (this.progress.isCanceled()) {
                // Only AbortCompilation can stop the compiler cleanly.
                // We check cancellation again following the call to compile.
                throw new AbortCompilation(true, null);
            }
            this.progress.setTaskName(taskDecription);
        }
    }
594457
def progress_report(self, force=False):
        '''
        
        '''
        now = datetime.datetime.now()
        if (len(self.task_stack) > 1 or self.task_stack[0] > 0) and \
                now - self.last_report < self.resolution and not force:
            return

        stack_printout = ', '.join('%s %s of %s' % (t.name, t.progress, t.size)
                                   for t in self.task_stack)

        frac_done = self.fraction_done()
        if frac_done == 0.0:
            now_str = now.strftime('%c')
            eta_str = 'unknown on %s' % now_str
        else:
            elapsed = (now - self.start_time)
            estimated_length = elapsed.total_seconds() / frac_done
            eta = self.start_time + datetime.timedelta(seconds=estimated_length)
            eta_str = eta.strftime('%c')

        print '%s (~%d%% done, ETA %s)' % (stack_printout,
                                           round(frac_done * 100.0),
                                           eta_str)
        self.last_report = datetime.datetime.now()
611911
long tryToGetOutputSize(TaskAttemptID taskId, JobConf conf) {

    try{
      TaskInProgress tip;
      synchronized(this) {
        tip = tasks.get(taskId);
      }
      if(tip == null)
         return -1;

      if (!tip.getTask().isMapTask() ||
          tip.getRunState() != TaskStatus.State.SUCCEEDED) {
        return -1;
      }

      MapOutputFile mapOutputFile = new MapOutputFile();
      mapOutputFile.setJobId(taskId.getJobID());
      mapOutputFile.setConf(conf);

      // In simulation mode, maps/reduces complete instantly and don't produce
      // any output
      if (this.simulatedTaskMode) {
        return 0;
      }

      Path tmp_output = null;
      try {
        tmp_output =  mapOutputFile.getOutputFile(taskId);
      } catch (DiskErrorException dex) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Error getting map output of a task " + taskId, dex);
        }
      }
      if(tmp_output == null)
        return 0;
      FileSystem localFS = FileSystem.getLocal(conf);
      FileStatus stat = localFS.getFileStatus(tmp_output);
      if(stat == null)
        return 0;
      else
        return stat.getLen();
    } catch(IOException e) {
      LOG.info(e);
      return -1;
    }
  }
283141
private String getTaskField(int key)
   {
      String result = null;

      if ((key > 0) && (key < m_taskNames.length))
      {
         result = m_taskNames[key];
      }

      return (result);
   }
411070
def progress(self):
        
        return Progress(
            done=len(self._get_all_set_properties()),
            base=len(worker_mapping()),
        )