You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by he...@apache.org on 2011/10/18 19:32:27 UTC

svn commit: r1185767 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/HadoopJobExecHelper.java

Author: heyongqiang
Date: Tue Oct 18 17:32:27 2011
New Revision: 1185767

URL: http://svn.apache.org/viewvc?rev=1185767&view=rev
Log:
HIVE-2487: Bug from HIVE-2446, the code that calls client stats publishers should be inside the while loop (Robert Surówka via He Yongqiang)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/HadoopJobExecHelper.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/HadoopJobExecHelper.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/HadoopJobExecHelper.java?rev=1185767&r1=1185766&r2=1185767&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/HadoopJobExecHelper.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/HadoopJobExecHelper.java Tue Oct 18 17:32:27 2011
@@ -310,6 +310,20 @@ public class HadoopJobExecHelper {
       errMsg.setLength(0);
 
       updateCounters(ctrs, rj);
+      
+      // Prepare data for Client Stat Publishers (if any present) and execute them
+      if (clientStatPublishers.size() > 0 && ctrs != null) {
+        Map<String, Double> exctractedCounters = extractAllCounterValues(ctrs);
+        for (ClientStatsPublisher clientStatPublisher : clientStatPublishers) {
+          try {
+            clientStatPublisher.run(exctractedCounters, rj.getID().toString());
+          } catch (RuntimeException runtimeException) {
+            LOG.error("Exception " + runtimeException.getClass().getCanonicalName()
+                + " thrown when running clientStatsPublishers. The stack trace is: ",
+                runtimeException);
+          }
+        }
+      }
 
       String report = " " + getId() + " map = " + mapProgress + "%,  reduce = " + reduceProgress
           + "%";
@@ -371,14 +385,6 @@ public class HadoopJobExecHelper {
       }
     }
 
-    //Prepare data for Client Stat Publishers (if any present) and execute them
-     if (clientStatPublishers.size() > 0 && ctrs != null){
-        Map<String, Double> exctractedCounters = extractAllCounterValues(ctrs);
-        for(ClientStatsPublisher clientStatPublisher : clientStatPublishers){
-          clientStatPublisher.run(exctractedCounters, rj.getID().toString());
-        }
-      }
-
     if (ctrs != null) {
       Counter counterCpuMsec = ctrs.findCounter("org.apache.hadoop.mapred.Task$Counter",
           "CPU_MILLISECONDS");