Retrieve information about the task

@param taskId ID of the task
@return Task details
196482
public Task getTaskDetails(String taskId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskId), "Task id cannot be blank");
        return getForEntity("tasks/{taskId}", null, Task.class, taskId);
    }
635828
public static TaskTemplate getTaskTemplate(String logicalId) {
        for (int i = 0; i < taskVoCache.size(); i++) {
            TaskTemplate task = taskVoCache.get(i);
            if (logicalId.equals(task.getLogicalId())) {
               return task;
            }
        }
        return null;
    }
174161
@Override
    public String getTaskId() {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "getTaskId", _taskId);
        return _taskId;
    }
655473
public static String extractTaskID(String path, String identifier) {
    LOG.debug("extract task id for {}", path);
    if (path.contains(HADOOP_ATTEMPT)) {
      String prf = path.substring(path.indexOf(HADOOP_ATTEMPT));
      if (prf.contains("/")) {
        return TaskAttemptID.forName(prf.substring(0, prf.indexOf("/"))).toString();
      }
      return TaskAttemptID.forName(prf).toString();
    } else if (identifier != null && path.contains(identifier)) {
      int ind = path.indexOf(identifier);
      String prf = path.substring(ind + identifier.length());
      int boundary = prf.length();
      if (prf.indexOf("/") > 0) {
        boundary = prf.indexOf("/");
      }
      String taskID =  prf.substring(0, boundary);
      LOG.debug("extracted task id {} for {}", taskID, path);
      return taskID;
    }
    return null;
  }
246925
private static Configuration getCLRTaskConfiguration(final String taskId) throws BindException {
    final ConfigurationBuilder taskConfigurationBuilder = Tang.Factory.getTang()
        .newConfigurationBuilder(loadClassHierarchy());
    taskConfigurationBuilder.bind("Org.Apache.Reef.Tasks.TaskConfigurationOptions+Identifier," +
        "Org.Apache.Reef.Tasks.ITask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca", taskId);
    taskConfigurationBuilder.bind("Org.Apache.Reef.Tasks.ITask, Org.Apache.Reef.Tasks.ITask, Version=1.0.0.0, " +
        "Culture=neutral, PublicKeyToken=69c3241e6f0468ca", "Org.Apache.Reef.Tasks.HelloTask, " +
        "Org.Apache.Reef.Tasks.HelloTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");

    return taskConfigurationBuilder.build();
  }
908595
public TaskStatus pollTaskStatus(String taskId, Map<String, String> reqHeaders) {
        CloseableHttpResponse resp = null;
        String url = format("%s/%s/status", format(overlordUrl, overlordHost, overlordPort), taskId);
        try {
            resp = get(url, reqHeaders);
            //TODO: Check for nulls in the following.
            JSONObject respJson = new JSONObject(IOUtils.toString(resp.getEntity().getContent()));
            JSONObject status = respJson.optJSONObject("status");
            if (status != null && null != status.getString("status")) {
                switch (status.getString("status")) {
                    case "SUCCESS":
                        return TaskStatus.SUCCESS;
                    case "RUNNING":
                        return TaskStatus.RUNNING;
                    default:
                        return TaskStatus.FAILED;
                }
            }
        } catch (IOException ex) {
            log.error("Error polling for task status {}", ExceptionUtils.getStackTrace(ex));
        } finally {
            returnClient(resp);
        }// Happens when result looks like {"task":"null"} which has no status(because such a task itself does not exist)
        return TaskStatus.UNKNOWN;
    }
986155
public OvhTaskPop domain_task_account_id_GET(String domain, Long id) throws IOException {
		String qPath = "/email/domain/{domain}/task/account/{id}";
		StringBuilder sb = path(qPath, domain, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhTaskPop.class);
	}
929663
def get_task_logs(self, taskId):

        

        req = self.url + "/api/case/task/{}/log".format(taskId)
        try:
            return requests.get(req, proxies=self.proxies, auth=self.auth, verify=self.cert)
        except requests.exceptions.RequestException as e:
            raise CaseTaskException("Case task logs search error: {}".format(e))
757539
public Task getTask(ExecutionAttemptID executionAttemptID) {
		TaskSlotMapping taskSlotMapping = taskSlotMappings.get(executionAttemptID);

		if (taskSlotMapping != null) {
			return taskSlotMapping.getTask();
		} else {
			return null;
		}
	}
767600
public List<TaskExecLog> getTaskLogs(String taskId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskId), "Task id cannot be blank");
        return stub.getTaskLogs(
                TaskServicePb.GetTaskLogsRequest.newBuilder().setTaskId(taskId).build()
        ).getLogsList()
                .stream()
                .map(protoMapper::fromProto)
                .collect(Collectors.toList());
    }
641890
public void completeTask(int taskId) {
		getResourceFactory().getApiResource("/task/" + taskId + "/complete")
				.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
	}
161436
public long getDispatchTime(TaskAttemptID taskid){
    Long l = dispatchTimeMap.get(taskid);
    if (l != null) {
      return l.longValue();
    }
    return 0;
  }
722281
TaskStatus[] getTaskStatuses(TaskID tipid) {
    TaskInProgress tip = getTip(tipid);
    return (tip == null ? new TaskStatus[0]
            : tip.getTaskStatuses());
  }
541178
public Collection<SingularityS3Log> getTaskLogs(String taskId) {
    final Function<String, String> requestUri = (host) -> String.format(S3_LOG_GET_TASK_LOGS, getApiBase(host), taskId);

    final String type = String.format("S3 logs for task %s", taskId);

    return getCollection(requestUri, type, S3_LOG_COLLECTION);
  }
666542
public static function taskGet($task_id)
    {
        $tasks = self::taskFileLoad();
        if (isset($tasks[$task_id])) {
            return $tasks[$task_id];
        }
        return false;
    }
398528
public synchronized void addTask(int taskId) {
    Preconditions.checkArgument(!mTaskIdToInfo.containsKey(taskId), "");
    mTaskIdToInfo.put(taskId, new TaskInfo().setJobId(mId).setTaskId(taskId)
        .setStatus(Status.CREATED).setErrorMessage("").setResult(null));
  }
547755
private void readTasks(Integer id)
   {
      Integer currentID = id;
      Table table = getTable("WBSTAB");

      while (currentID.intValue() != 0)
      {
         MapRow row = table.find(currentID);
         Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
         readLeafTasks(task, row.getInteger("FIRST_CHILD_TASK_ID"));
         Integer childID = row.getInteger("CHILD_ID");
         if (childID.intValue() != 0)
         {
            readTasks(childID);
         }
         currentID = row.getInteger("NEXT_ID");
      }
   }