diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java index 3de5556..4f6df27 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezJobMonitor.java @@ -310,7 +310,7 @@ public int monitorExecution(final DAGClient dagClient, HiveTxnManager txnMgr, Hi if (inPlaceEligible) { printStatusInPlace(progressMap, startTime, false, dagClient); // log the progress report to log file as well - console.logInfo(getReport(progressMap)); + lastReport = logStatus(progressMap, lastReport, console); } else { lastReport = printStatus(progressMap, lastReport, console); } @@ -319,7 +319,7 @@ public int monitorExecution(final DAGClient dagClient, HiveTxnManager txnMgr, Hi if (inPlaceEligible) { printStatusInPlace(progressMap, startTime, false, dagClient); // log the progress report to log file as well - console.logInfo(getReport(progressMap)); + lastReport = logStatus(progressMap, lastReport, console); } else { lastReport = printStatus(progressMap, lastReport, console); } @@ -344,7 +344,7 @@ public int monitorExecution(final DAGClient dagClient, HiveTxnManager txnMgr, Hi if (inPlaceEligible) { printStatusInPlace(progressMap, startTime, true, dagClient); // log the progress report to log file as well - console.logInfo(getReport(progressMap)); + lastReport = logStatus(progressMap, lastReport, console); } console.printInfo("Status: Killed"); running = false; @@ -356,7 +356,7 @@ public int monitorExecution(final DAGClient dagClient, HiveTxnManager txnMgr, Hi if (inPlaceEligible) { printStatusInPlace(progressMap, startTime, true, dagClient); // log the progress report to log file as well - console.logInfo(getReport(progressMap)); + lastReport = logStatus(progressMap, lastReport, console); } console.printError("Status: Failed"); running = false; @@ -749,6 +749,15 @@ private String printStatus(Map progressMap, String lastReport, return report; } + private String logStatus(Map progressMap, String lastReport, LogHelper console) { + String report = getReport(progressMap); + if (!report.equals(lastReport) || System.currentTimeMillis() >= lastPrintTime + printInterval) { + console.logInfo(report); + lastPrintTime = System.currentTimeMillis(); + } + return report; + } + private String getReport(Map progressMap) { StringBuffer reportBuffer = new StringBuffer();