Java Code Examples for org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsResponse

The following examples show how to use org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsResponse. These examples are extracted from open source projects. 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 Project: hadoop   Source File: MRClientService.java    License: 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 Project: hadoop   Source File: ClientServiceDelegate.java    License: Apache License 2.0 6 votes vote down vote up
public org.apache.hadoop.mapreduce.TaskReport[] getTaskReports(JobID oldJobID, TaskType taskType)
     throws IOException{
  org.apache.hadoop.mapreduce.v2.api.records.JobId jobId =
    TypeConverter.toYarn(oldJobID);
  GetTaskReportsRequest request =
      recordFactory.newRecordInstance(GetTaskReportsRequest.class);
  request.setJobId(jobId);
  request.setTaskType(TypeConverter.toYarn(taskType));

  List<org.apache.hadoop.mapreduce.v2.api.records.TaskReport> taskReports =
    ((GetTaskReportsResponse) invoke("getTaskReports", GetTaskReportsRequest.class,
        request)).getTaskReportList();

  return TypeConverter.fromYarn
  (taskReports).toArray(new org.apache.hadoop.mapreduce.TaskReport[0]);
}
 
Example 3
Source Project: big-c   Source File: MRClientService.java    License: 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 4
Source Project: big-c   Source File: ClientServiceDelegate.java    License: Apache License 2.0 6 votes vote down vote up
public org.apache.hadoop.mapreduce.TaskReport[] getTaskReports(JobID oldJobID, TaskType taskType)
     throws IOException{
  org.apache.hadoop.mapreduce.v2.api.records.JobId jobId =
    TypeConverter.toYarn(oldJobID);
  GetTaskReportsRequest request =
      recordFactory.newRecordInstance(GetTaskReportsRequest.class);
  request.setJobId(jobId);
  request.setTaskType(TypeConverter.toYarn(taskType));

  List<org.apache.hadoop.mapreduce.v2.api.records.TaskReport> taskReports =
    ((GetTaskReportsResponse) invoke("getTaskReports", GetTaskReportsRequest.class,
        request)).getTaskReportList();

  return TypeConverter.fromYarn
  (taskReports).toArray(new org.apache.hadoop.mapreduce.TaskReport[0]);
}
 
Example 5
Source Project: hadoop   Source File: NotRunningJob.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  GetTaskReportsResponse resp =
    recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  resp.addAllTaskReports(new ArrayList<TaskReport>());
  return resp;
}
 
Example 6
Source Project: hadoop   Source File: MRClientProtocolPBServiceImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponseProto getTaskReports(RpcController controller,
    GetTaskReportsRequestProto proto) throws ServiceException {
  GetTaskReportsRequest request = new GetTaskReportsRequestPBImpl(proto);
  try {
    GetTaskReportsResponse response = real.getTaskReports(request);
    return ((GetTaskReportsResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
 
Example 7
Source Project: hadoop   Source File: MRClientProtocolPBClientImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  GetTaskReportsRequestProto requestProto = ((GetTaskReportsRequestPBImpl)request).getProto();
  try {
    return new GetTaskReportsResponsePBImpl(proxy.getTaskReports(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
 
Example 8
Source Project: hadoop   Source File: HistoryClientService.java    License: 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 9
Source Project: big-c   Source File: NotRunningJob.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  GetTaskReportsResponse resp =
    recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  resp.addAllTaskReports(new ArrayList<TaskReport>());
  return resp;
}
 
Example 10
Source Project: big-c   Source File: MRClientProtocolPBServiceImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponseProto getTaskReports(RpcController controller,
    GetTaskReportsRequestProto proto) throws ServiceException {
  GetTaskReportsRequest request = new GetTaskReportsRequestPBImpl(proto);
  try {
    GetTaskReportsResponse response = real.getTaskReports(request);
    return ((GetTaskReportsResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
 
Example 11
Source Project: big-c   Source File: MRClientProtocolPBClientImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  GetTaskReportsRequestProto requestProto = ((GetTaskReportsRequestPBImpl)request).getProto();
  try {
    return new GetTaskReportsResponsePBImpl(proxy.getTaskReports(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
 
Example 12
Source Project: big-c   Source File: HistoryClientService.java    License: 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 13
Source Project: incubator-tez   Source File: NotRunningJob.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  GetTaskReportsResponse resp =
    recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  resp.addAllTaskReports(new ArrayList<TaskReport>());
  return resp;
}
 
Example 14
Source Project: tez   Source File: NotRunningJob.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  GetTaskReportsResponse resp =
    recordFactory.newRecordInstance(GetTaskReportsResponse.class);
  resp.addAllTaskReports(new ArrayList<TaskReport>());
  return resp;
}
 
Example 15
Source Project: hadoop   Source File: TestClientRedirect.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GetTaskReportsResponse
    getTaskReports(GetTaskReportsRequest request)
        throws IOException {
  return null;
}
 
Example 16
Source Project: hadoop   Source File: TestRPCFactories.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  return null;
}
 
Example 17
Source Project: big-c   Source File: TestClientRedirect.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GetTaskReportsResponse
    getTaskReports(GetTaskReportsRequest request)
        throws IOException {
  return null;
}
 
Example 18
Source Project: big-c   Source File: TestRPCFactories.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
    throws IOException {
  return null;
}
 
Example 19
Source Project: hadoop   Source File: MRClientProtocol.java    License: Apache License 2.0 votes vote down vote up
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request) throws IOException; 
Example 20
Source Project: big-c   Source File: MRClientProtocol.java    License: Apache License 2.0 votes vote down vote up
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request) throws IOException;