Java Code Examples for org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest#getTaskType()

The following examples show how to use org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest#getTaskType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MRClientService.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(
    GetTaskReportsRequest request) throws IOException {
  JobId jobId = request.getJobId();
  TaskType taskType = request.getTaskType();
  
  GetTaskReportsResponse response = 
    recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  
  Job job = verifyAndGetJob(jobId, JobACL.VIEW_JOB, true);
  Collection<Task> tasks = job.getTasks(taskType).values();
  LOG.info("Getting task report for " + taskType + "   " + jobId
      + ". Report-size will be " + tasks.size());

  // Take lock to allow only one call, otherwise heap will blow up because
  // of counters in the report when there are multiple callers.
  synchronized (getTaskReportsLock) {
    for (Task task : tasks) {
      response.addTaskReport(task.getReport());
    }
  }

  return response;
}
 
Example 2
Source File: MRClientService.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(
    GetTaskReportsRequest request) throws IOException {
  JobId jobId = request.getJobId();
  TaskType taskType = request.getTaskType();
  
  GetTaskReportsResponse response = 
    recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  
  Job job = verifyAndGetJob(jobId, JobACL.VIEW_JOB, true);
  Collection<Task> tasks = job.getTasks(taskType).values();
  LOG.info("Getting task report for " + taskType + "   " + jobId
      + ". Report-size will be " + tasks.size());

  // Take lock to allow only one call, otherwise heap will blow up because
  // of counters in the report when there are multiple callers.
  synchronized (getTaskReportsLock) {
    for (Task task : tasks) {
      response.addTaskReport(task.getReport());
    }
  }

  return response;
}
 
Example 3
Source File: HistoryClientService.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  JobId jobId = request.getJobId();
  TaskType taskType = request.getTaskType();

  GetTaskReportsResponse response = recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  Job job = verifyAndGetJob(jobId, true);
  Collection<Task> tasks = job.getTasks(taskType).values();
  for (Task task : tasks) {
    response.addTaskReport(task.getReport());
  }
  return response;
}
 
Example 4
Source File: HistoryClientService.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  JobId jobId = request.getJobId();
  TaskType taskType = request.getTaskType();

  GetTaskReportsResponse response = recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  Job job = verifyAndGetJob(jobId, true);
  Collection<Task> tasks = job.getTasks(taskType).values();
  for (Task task : tasks) {
    response.addTaskReport(task.getReport());
  }
  return response;
}