|
@@ -71,10 +71,15 @@ public class JobCounterInfo {
|
|
|
}
|
|
|
|
|
|
private void getCounters(AppContext ctx, Job job) {
|
|
|
- total = new Counters();
|
|
|
if (job == null) {
|
|
|
return;
|
|
|
}
|
|
|
+ total = job.getAllCounters();
|
|
|
+ boolean needTotalCounters = false;
|
|
|
+ if (total == null) {
|
|
|
+ total = new Counters();
|
|
|
+ needTotalCounters = true;
|
|
|
+ }
|
|
|
map = new Counters();
|
|
|
reduce = new Counters();
|
|
|
// Get all types of counters
|
|
@@ -84,7 +89,6 @@ public class JobCounterInfo {
|
|
|
if (counters == null) {
|
|
|
continue;
|
|
|
}
|
|
|
- total.incrAllCounters(counters);
|
|
|
switch (t.getType()) {
|
|
|
case MAP:
|
|
|
map.incrAllCounters(counters);
|
|
@@ -93,6 +97,9 @@ public class JobCounterInfo {
|
|
|
reduce.incrAllCounters(counters);
|
|
|
break;
|
|
|
}
|
|
|
+ if (needTotalCounters) {
|
|
|
+ total.incrAllCounters(counters);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|