本文整理汇总了Java中org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest类的典型用法代码示例。如果您正苦于以下问题:Java GetTaskReportsRequest类的具体用法?Java GetTaskReportsRequest怎么用?Java GetTaskReportsRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GetTaskReportsRequest类属于org.apache.hadoop.mapreduce.v2.api.protocolrecords包,在下文中一共展示了GetTaskReportsRequest类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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;
}
示例2: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
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]);
}
示例3: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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);
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;
}
示例4: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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, false);
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;
}
示例5: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@Override
public GetTaskReportsResponse getTaskReports(GetTaskReportsRequest request)
throws IOException {
GetTaskReportsResponse resp =
recordFactory.newRecordInstance(GetTaskReportsResponse.class);
resp.addAllTaskReports(new ArrayList<TaskReport>());
return resp;
}
示例6: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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);
}
}
示例7: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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);
}
}
示例8: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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;
}
示例9: getTaskReports
import org.apache.hadoop.mapreduce.v2.api.protocolrecords.GetTaskReportsRequest; //导入依赖的package包/类
@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);
Collection<Task> tasks = job.getTasks(taskType).values();
for (Task task : tasks) {
response.addTaskReport(task.getReport());
}
return response;
}