From 7122cb5bf4a29796d562e229d777829f75f7908a Mon Sep 17 00:00:00 2001 From: Thomas Graves Date: Thu, 7 Mar 2013 23:02:28 +0000 Subject: [PATCH] MAPREDUCE-5023. History Server Web Services missing Job Counters (Ravi Prakash via tgraves) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1454156 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../mapreduce/v2/app/webapp/dao/JobCounterInfo.java | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 5952dd5b53..54d4ac7292 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -804,6 +804,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 diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java index 8d5c46992c..2d3e246922 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobCounterInfo.java @@ -71,10 +71,15 @@ public JobCounterInfo(AppContext ctx, Job job) { } 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 @@ private void getCounters(AppContext ctx, Job job) { if (counters == null) { continue; } - total.incrAllCounters(counters); switch (t.getType()) { case MAP: map.incrAllCounters(counters); @@ -93,6 +97,9 @@ private void getCounters(AppContext ctx, Job job) { reduce.incrAllCounters(counters); break; } + if (needTotalCounters) { + total.incrAllCounters(counters); + } } }