hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject hive git commit: HIVE-14215: Displaying inconsistent CPU usage data with MR execution engine (Peter Vary, reviewed by Aihua Xu and Sergio Pena)
Date Thu, 14 Jul 2016 16:28:13 GMT
Repository: hive
Updated Branches:
  refs/heads/master 502c652a8 -> feedee4c9


HIVE-14215: Displaying inconsistent CPU usage data with MR execution engine (Peter Vary, reviewed
by Aihua Xu and Sergio Pena)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/feedee4c
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/feedee4c
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/feedee4c

Branch: refs/heads/master
Commit: feedee4c922402339f2302bcc1c9be1ad9a47bba
Parents: 502c652
Author: Peter Vary <pvary@cloudera.com>
Authored: Thu Jul 14 11:27:18 2016 -0500
Committer: Sergio Pena <sergio.pena@cloudera.com>
Committed: Thu Jul 14 11:28:04 2016 -0500

----------------------------------------------------------------------
 .../hive/ql/exec/mr/HadoopJobExecHelper.java    | 25 ++++++++++----------
 1 file changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/feedee4c/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HadoopJobExecHelper.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HadoopJobExecHelper.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HadoopJobExecHelper.java
index cfb4a28..bb6ed84 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HadoopJobExecHelper.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HadoopJobExecHelper.java
@@ -375,6 +375,19 @@ public class HadoopJobExecHelper {
       reportTime = System.currentTimeMillis();
     }
 
+    Counters ctrs = th.getCounters();
+
+    if (ctrs != null) {
+      Counter counterCpuMsec = ctrs.findCounter("org.apache.hadoop.mapred.Task$Counter",
+              "CPU_MILLISECONDS");
+      if (counterCpuMsec != null) {
+        long newCpuMSec = counterCpuMsec.getValue();
+        if (newCpuMSec > cpuMsec) {
+          cpuMsec = newCpuMSec;
+        }
+      }
+    }
+
     if (cpuMsec > 0) {
       String status = "MapReduce Total cumulative CPU time: " + Utilities.formatMsecToStr(cpuMsec);
       console.printInfo(status);
@@ -383,7 +396,6 @@ public class HadoopJobExecHelper {
 
     boolean success;
 
-    Counters ctrs = th.getCounters();
     if (fatal) {
       success = false;
     } else {
@@ -401,17 +413,6 @@ public class HadoopJobExecHelper {
       }
     }
 
-    if (ctrs != null) {
-      Counter counterCpuMsec = ctrs.findCounter("org.apache.hadoop.mapred.Task$Counter",
-          "CPU_MILLISECONDS");
-      if (counterCpuMsec != null) {
-        long newCpuMSec = counterCpuMsec.getValue();
-        if (newCpuMSec > cpuMsec) {
-          cpuMsec = newCpuMSec;
-        }
-      }
-    }
-
     MapRedStats mapRedStats = new MapRedStats(numMap, numReduce, cpuMsec, success, rj.getID().toString());
     mapRedStats.setCounters(ctrs);
 


Mime
View raw message