Counters counter = mapTaskReport.getCounters();
Iterator<Group> iter = counter.iterator();
while (iter.hasNext()) {
Group group = iter.next();
Iterator<Counter> cIter = group.iterator();
while (cIter.hasNext()) {
Counter c = cIter.next();
taskCounters.append(" <counter name='").append(c.getDisplayName()).append("' value='").append(c.getValue()).append("'>\n");
}
}
taskCounters.append(" </counters>\n");
taskCounters.append(" </task>\n");
}
taskCounters.append(" </mapTasks>\n");
taskCounters.append(" <reduceTasks>\n");
for (TaskReport reduceTaskReport : reduceTaskReports) {
taskCounters.append(" <task id='").append(reduceTaskReport.getTaskID().toString()).append("'\n");
taskCounters.append(" <counters>\n");
Counters counter = reduceTaskReport.getCounters();
Iterator<Group> iter = counter.iterator();
while (iter.hasNext()) {
Group group = iter.next();
Iterator<Counter> cIter = group.iterator();
while (cIter.hasNext()) {
Counter c = cIter.next();
taskCounters.append(" <counter name='").append(c.getDisplayName()).append("' value='").append(c.getValue()).append("'>\n");
}
}