hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gunt...@apache.org
Subject svn commit: r1534898 - /hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java
Date Wed, 23 Oct 2013 03:30:57 GMT
Author: gunther
Date: Wed Oct 23 03:30:57 2013
New Revision: 1534898

URL: http://svn.apache.org/r1534898
Log:
HIVE-5620: Tez job progress printing stops after a specific amount of time (Siddharth Seth
via Gunther Hagleitner)

Modified:
    hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java

Modified: hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java?rev=1534898&r1=1534897&r2=1534898&view=diff
==============================================================================
--- hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java (original)
+++ hive/branches/tez/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java Wed
Oct 23 03:30:57 2013
@@ -48,8 +48,13 @@ public class TezJobMonitor {
 
   private transient LogHelper console;
   private final PerfLogger perfLogger = PerfLogger.getPerfLogger();
+  private final int checkInterval = 200;
+  private final int maxRetryInterval = 2500;
+  private final int printInterval = 3000;
+  private long lastPrintTime;
   private Set<String> completed;
 
+
   public TezJobMonitor() {
     console = new LogHelper(LOG);
   }
@@ -67,10 +72,6 @@ public class TezJobMonitor {
 
     boolean running = false;
     boolean done = false;
-    int checkInterval = 200;
-    int printInterval = 3000;
-    int maxRetryInterval = 2500;
-    int counter = 0;
     int failedCounter = 0;
     int rc = 0;
     DAGStatus.State lastState = null;
@@ -81,7 +82,6 @@ public class TezJobMonitor {
     perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_SUBMIT_TO_RUNNING);
 
     while(true) {
-      ++counter;
 
       try {
         status = dagClient.getDAGStatus();
@@ -108,9 +108,7 @@ public class TezJobMonitor {
               running = true;
             }
 
-            if (counter % printInterval/checkInterval == 0) {
-              lastReport = printStatus(progressMap, lastReport, console);
-            }
+            lastReport = printStatus(progressMap, lastReport, console);
             break;
           case SUCCEEDED:
             lastReport = printStatus(progressMap, lastReport, console);
@@ -190,8 +188,9 @@ public class TezJobMonitor {
     }
 
     String report = reportBuffer.toString();
-    if (!report.equals(lastReport)) {
+    if (!report.equals(lastReport) || System.currentTimeMillis() >= lastPrintTime + printInterval)
{
       console.printInfo(report);
+      lastPrintTime = System.currentTimeMillis();
     }
 
     return report;



Mime
View raw message