热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.hadoop.mapred.TaskReport类的使用及代码示例

本文整理了Java中org.apache.hadoop.mapred.TaskReport类的一些代码示例,展示了TaskReport类的具体

本文整理了Java中org.apache.hadoop.mapred.TaskReport类的一些代码示例,展示了TaskReport类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TaskReport类的具体详情如下:
包路径:org.apache.hadoop.mapred.TaskReport
类名称:TaskReport

TaskReport介绍

[英]A report on the state of a task.
[中]关于任务状态的报告。

代码示例

代码示例来源:origin: twitter/ambrose

if (report.getStartTime() jobStartTime = report.getStartTime();
TIPStatus status = report.getCurrentStatus();
if (status != TIPStatus.PENDING && status != TIPStatus.RUNNING) {
finishedMappersCount++;
if (jobLastUpdateTime jobLastUpdateTime = report.getFinishTime();
TIPStatus status = report.getCurrentStatus();
if (status != TIPStatus.PENDING && status != TIPStatus.RUNNING) {
finishedReducersCount++;

代码示例来源:origin: linkedin/camus

if (tasks.length > 0) {
for (TaskReport task : client.getMapTaskReports(tasks[0].getTaskAttemptId().getJobID())) {
if (task.getCurrentStatus().equals(TIPStatus.FAILED)) {
for (String s : task.getDiagnostics()) {
System.err.println("task error: " + s);

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

@Override
public boolean equals(Object o) {
if(o == null)
return false;
if(o.getClass().equals(TaskReport.class)) {
TaskReport report = (TaskReport) o;
return counters.contentEquals(report.getCounters())
&& Arrays.toString(this.diagnostics)
.equals(Arrays.toString(report.getDiagnostics()))
&& this.finishTime == report.getFinishTime()
&& this.progress == report.getProgress()
&& this.startTime == report.getStartTime()
&& this.state.equals(report.getState())
&& this.taskid.equals(report.getTaskID());
}
return false;
}

代码示例来源:origin: cdapio/cdap

private List toMRTaskInfos(TaskReport[] taskReports) {
List taskInfos = Lists.newArrayList();
for (TaskReport taskReport : taskReports) {
taskInfos.add(new MRTaskInfo(taskReport.getTaskId(), taskReport.getState(),
taskReport.getStartTime(), taskReport.getFinishTime(), taskReport.getProgress(),
groupToMap(taskReport.getCounters().getGroup(TaskCounter.class.getName()))));
}
return taskInfos;
}

代码示例来源:origin: com.linkedin.camus/camus-etl-kafka

long wait = t.getStartTime() - timingMap.get("hadoop_start");
min = wait max = wait > max ? wait : max;
mean += wait;
long runTime = t.getFinishTime() - t.getStartTime();
totalTaskTime += runTime;
minRun = runTime

代码示例来源:origin: apache/datafu

for (TaskReport report : jobClient.getSetupTaskReports(oldJobId))
taskIdToType.put(report.getTaskID().toString(),"SETUP");
if (report.getStartTime() == 0)
setupStart = Math.min(setupStart, report.getStartTime());
for (TaskReport report : mapReports)
taskIdToType.put(report.getTaskID().toString(),"MAP");
if (report.getFinishTime() == 0 || report.getStartTime() == 0)
minStart = Math.min(minStart, report.getStartTime());
mapStats.addValue(report.getFinishTime() - report.getStartTime());
for (TaskReport report : reduceReports)
taskIdToType.put(report.getTaskID().toString(),"REDUCE");
if (report.getFinishTime() == 0 || report.getStartTime() == 0)
maxFinish = Math.max(maxFinish, report.getFinishTime());
reduceStats.addValue(report.getFinishTime() - report.getStartTime());
taskIdToType.put(report.getTaskID().toString(),"CLEANUP");
if (report.getFinishTime() == 0)
cleanupFinish = Math.max(cleanupFinish, report.getFinishTime());

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/**
* Creates a "status report" for this task. Includes the
* task ID and overall status, plus reports for all the
* component task-threads that have ever been started.
*/
synchronized TaskReport generateSingleReport() {
ArrayList diagnostics = new ArrayList();
for (List l : taskDiagnosticData.values()) {
diagnostics.addAll(l);
}
TaskReport report = new TaskReport
(getTIPId(), (float)progress, state,
diagnostics.toArray(new String[diagnostics.size()]),
execStartTime, execFinishTime, counters);

return report;
}

代码示例来源:origin: stackoverflow.com

Job job = ...;
job.waitForCompletion();
TaskReport[] reports = job.getTaskReports(TaskType.MAP);
for(TaskReport report : reports) {
long time = report.getFinishTime() - report.getStartTime();
System.out.println(report.getTaskId() + " took " + time + " millis!");
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

@Test(timeout = 5000)
public void testTaskID() throws IOException, InterruptedException {
JobID jobid = new JobID("1014873536921", 6);
TaskID tid = new TaskID(jobid, TaskType.MAP, 0);
org.apache.hadoop.mapred.TaskID tid1 =
org.apache.hadoop.mapred.TaskID.downgrade(tid);
org.apache.hadoop.mapred.TaskReport treport =
new org.apache.hadoop.mapred.TaskReport(tid1, 0.0f,
State.FAILED.toString(), null, TIPStatus.FAILED, 100, 100,
new org.apache.hadoop.mapred.Counters());
Assert
.assertEquals(treport.getTaskId(), "task_1014873536921_0006_m_000000");
Assert.assertEquals(treport.getTaskID().toString(),
"task_1014873536921_0006_m_000000");
}
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

TaskReport report = new TaskReport
(getTIPId(), (float)progress, state,
diagnostics.toArray(new String[diagnostics.size()]),
currentStatus, execStartTime, execFinishTime, counters);
if (currentStatus == TIPStatus.RUNNING) {
report.setRunningTaskAttempts(activeTasks.keySet());
} else if (currentStatus == TIPStatus.COMPLETE) {
report.setSuccessfulAttempt(getSuccessfulTaskid());

代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-core

private TaskReport[] getTaskReports(final JobID jobId, TaskType type) throws
IOException {
try {
Job j = getJobUsingCluster(jobId);
if(j == null) {
return EMPTY_TASK_REPORTS;
}
return TaskReport.downgradeArray(j.getTaskReports(type));
} catch (InterruptedException ie) {
throw new IOException(ie);
}
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

TaskReport mapReports[] = jc.getMapTaskReports(rJob.getID());
for (TaskReport mapReport : mapReports) {
if (mapReport.getCurrentStatus() == TIPStatus.RUNNING) {
runningTasks.addAll(mapReport.getRunningTaskAttempts());
TaskReport reduceReports[] = jc.getReduceTaskReports(rJob.getID());
for (TaskReport reduceReport : reduceReports) {
if (reduceReport.getCurrentStatus() == TIPStatus.RUNNING) {
runningTasks.addAll(reduceReport.getRunningTaskAttempts());

代码示例来源:origin: org.apache.hadoop/hadoop-mapred

/**Computes average progress per bar*/
private float getMapAvarageProgress(int tasksPerBar, int index
, TaskReport[] reports ) {
float progress = 0f;
int k=0;
for(;k progress += reports[index + k].getProgress();
}
progress /= k;
return progress;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-core

static TaskReport[] downgradeArray(org.apache.hadoop.
mapreduce.TaskReport[] reports) {
List ret = new ArrayList();
for (org.apache.hadoop.mapreduce.TaskReport report : reports) {
ret.add(downgrade(report));
}
return ret.toArray(new TaskReport[0]);
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

private void printTaskAttempts(TaskReport report) {
if (report.getCurrentStatus() == TIPStatus.COMPLETE) {
System.out.println(report.getSuccessfulTaskAttempt());
} else if (report.getCurrentStatus() == TIPStatus.RUNNING) {
for (TaskAttemptID t :
report.getRunningTaskAttempts()) {
System.out.println(t);
}
}
}
/**

代码示例来源:origin: LiveRamp/cascading_ext

Collection running = report.getRunningTaskAttempts();
for(TaskAttemptID attempt: running){
taskAttemptToProgress.put(attempt, report.getProgress());

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

private TaskID getTIPId(MiniMRCluster cluster,
org.apache.hadoop.mapreduce.JobID jobid) throws Exception {
JobClient client = new JobClient(cluster.createJobConf());
JobID jobId = JobID.downgrade(jobid);
TaskReport[] mapReports = null;
TaskID tipId = null;
do { // make sure that the map task is running
Thread.sleep(200);
mapReports = client.getMapTaskReports(jobId);
} while (mapReports.length == 0);
for (TaskReport r : mapReports) {
tipId = r.getTaskID();
break;// because we have only one map
}
return tipId;
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

.getMapTaskReports(JobID.downgrade(job.getJobID()))));
for (TaskReport tr : allTaskReports) {
String[] diag = tr.getDiagnostics();
for (String str : diag) {
mat = taskOverLimitPattern.matcher(str);

代码示例来源:origin: com.facebook.hadoop/hadoop-core

TIPStatus status = report.getCurrentStatus();
if ((state.equals("pending") && status ==TIPStatus.PENDING) ||
(state.equals("running") && status ==TIPStatus.RUNNING) ||

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

@SuppressWarnings("deprecation")
private long getTaskCounterUsage (JobClient client, JobID id, int numReports,
int taskId, TaskType type)
throws Exception {
TaskReport[] reports = null;
if (TaskType.MAP.equals(type)) {
reports = client.getMapTaskReports(id);
} else if (TaskType.REDUCE.equals(type)) {
reports = client.getReduceTaskReports(id);
}

assertNotNull("No reports found for task type '" + type.name()
+ "' in job " + id, reports);
// make sure that the total number of reports match the expected
assertEquals("Mismatch in task id", numReports, reports.length);

Counters counters = reports[taskId].getCounters();

return counters.getCounter(TaskCounter.COMMITTED_HEAP_BYTES);
}

推荐阅读
  • 本文详细介绍了 Java 中 org.w3c.dom.Node 类的 isEqualNode() 方法的功能、参数及返回值,并通过多个实际代码示例来展示其具体应用。此方法用于检测两个节点是否相等,而不仅仅是判断它们是否为同一个对象。 ... [详细]
  • 本文详细介绍了 `org.apache.tinkerpop.gremlin.structure.VertexProperty` 类中的 `key()` 方法,并提供了多个实际应用的代码示例。通过这些示例,读者可以更好地理解该方法在图数据库操作中的具体用途。 ... [详细]
  • mysql 授权!!
    为什么80%的码农都做不了架构师?MySQL的权限系统围绕着两个概念:认证-确定用户是否允许连接数据库服务器授权-确定用户是否拥有足够的权限执 ... [详细]
  • 我在尝试将组合框转换为具有自动完成功能时遇到了一个问题,即页面上的列表框也被转换成了自动完成下拉框,而不是保持原有的多选列表框形式。 ... [详细]
  • 解决Bootstrap DataTable Ajax请求重复问题
    在最近的一个项目中,我们使用了JQuery DataTable进行数据展示,虽然使用起来非常方便,但在测试过程中发现了一个问题:当查询条件改变时,有时查询结果的数据不正确。通过FireBug调试发现,点击搜索按钮时,会发送两次Ajax请求,一次是原条件的请求,一次是新条件的请求。 ... [详细]
  • 本文详细介绍了在PHP中如何获取和处理HTTP头部信息,包括通过cURL获取请求头信息、使用header函数发送响应头以及获取客户端HTTP头部的方法。同时,还探讨了PHP中$_SERVER变量的使用,以获取客户端和服务器的相关信息。 ... [详细]
  • 个人博客:打开链接依赖倒置原则定义依赖倒置原则(DependenceInversionPrinciple,DIP)定义如下:Highlevelmo ... [详细]
  • 本文详细探讨了select和epoll两种I/O多路复用技术的内部实现原理,分析了它们在处理大量文件描述符时的性能差异,并通过具体示例代码展示了select的工作流程。 ... [详细]
  • 本文介绍了如何通过安装和配置php_uploadprogress扩展来实现文件上传时的进度条显示功能。通过一个简单的示例,详细解释了从安装扩展到编写具体代码的全过程。 ... [详细]
  • Hadoop MapReduce 实战案例:手机流量使用统计分析
    本文通过一个具体的Hadoop MapReduce案例,详细介绍了如何利用MapReduce框架来统计和分析手机用户的流量使用情况,包括上行和下行流量的计算以及总流量的汇总。 ... [详细]
  • 本文详细介绍了Elasticsearch中的分页查询机制,包括基本的分页查询流程、'from-size'浅分页与'scroll'深分页的区别及应用场景,以及两者在性能上的对比。 ... [详细]
  • 尽管Medium是一个优秀的发布平台,但在其之外拥有自己的博客仍然非常重要。这不仅提供了另一个与读者互动的渠道,还能确保您的内容安全。本文将介绍如何使用Bash脚本将Medium文章迁移到个人博客。 ... [详细]
  • 本文整理了 DedeCMS 中常用的标签分类及其具体应用方法,包括标题调用、导航调用、文章列表、子栏目调用、尾部信息调用等。 ... [详细]
  • C#实现文件的压缩与解压
    2019独角兽企业重金招聘Python工程师标准一、准备工作1、下载ICSharpCode.SharpZipLib.dll文件2、项目中引用这个dll二、文件压缩与解压共用类 ... [详细]
  • MySQL 5.7 学习指南:SQLyog 中的主键、列属性和数据类型
    本文介绍了 MySQL 5.7 中主键(Primary Key)和自增(Auto-Increment)的概念,以及如何在 SQLyog 中设置这些属性。同时,还探讨了数据类型的分类和选择,以及列属性的设置方法。 ... [详细]
author-avatar
zhenhuaYang
编程、骑行、健身、民谣、生活!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有