Author: tgraves Date: Thu Mar 7 23:03:10 2013 New Revision: 1454157 URL: http://svn.apache.org/r1454157 Log: MAPREDUCE-5023. History Server Web Services missing Job Counters (Ravi Prakash via tgraves)
Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt?rev=1454157&r1=1454156&r2=1454157&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt Thu Mar 7 23:03:10 2013 @@ -630,6 +630,9 @@ Release 0.23.7 - UNRELEASED MAPREDUCE-5043. Fetch failure processing can cause AM event queue to backup and eventually OOM (Jason Lowe via bobby) + MAPREDUCE-5023. History Server Web Services missing Job Counters (Ravi + Prakash via tgraves) + Release 0.23.6 - UNRELEASED INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java?rev=1454157&r1=1454156&r2=1454157&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java (original) +++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java Thu Mar 7 23:03:10 2013 @@ -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); + } } }