Repository: hive
Updated Branches:
  refs/heads/llap cae3ec16b -> 581d3bbc3


HIVE-10480. Fix an issue with initial heartbeats which lead to serialization 
errors and work timing out. (Siddharth Seth)


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

Branch: refs/heads/llap
Commit: 581d3bbc39ecddb180ecb4fb9795a3c663af6e2a
Parents: cae3ec1
Author: Siddharth Seth <ss...@apache.org>
Authored: Wed Apr 29 08:45:22 2015 -0700
Committer: Siddharth Seth <ss...@apache.org>
Committed: Wed Apr 29 08:45:22 2015 -0700

----------------------------------------------------------------------
 .../hive/llap/daemon/impl/LlapTaskReporter.java   | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/581d3bbc/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTaskReporter.java
----------------------------------------------------------------------
diff --git 
a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTaskReporter.java
 
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTaskReporter.java
index ef596ac..f3771ea 100644
--- 
a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTaskReporter.java
+++ 
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTaskReporter.java
@@ -32,11 +32,8 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.ReentrantLock;
 
-import com.google.common.base.Preconditions;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.hadoop.hive.llap.protocol.LlapTaskUmbilicalProtocol;
-import org.apache.hadoop.io.Text;
-import org.apache.tez.common.TezTaskUmbilicalProtocol;
 import org.apache.tez.common.counters.TezCounters;
 import org.apache.tez.dag.api.TezException;
 import org.apache.tez.dag.records.TezTaskAttemptID;
@@ -45,6 +42,7 @@ import 
org.apache.tez.runtime.api.events.TaskAttemptCompletedEvent;
 import org.apache.tez.runtime.api.events.TaskAttemptFailedEvent;
 import org.apache.tez.runtime.api.events.TaskStatusUpdateEvent;
 import org.apache.tez.runtime.api.impl.EventMetaData;
+import org.apache.tez.runtime.api.impl.TaskStatistics;
 import org.apache.tez.runtime.api.impl.TezEvent;
 import org.apache.tez.runtime.api.impl.TezHeartbeatRequest;
 import org.apache.tez.runtime.api.impl.TezHeartbeatResponse;
@@ -327,8 +325,18 @@ public class LlapTaskReporter implements 
TaskReporterInterface {
     }
 
     private TaskStatusUpdateEvent getStatusUpdateEvent(boolean sendCounters) {
-      return new TaskStatusUpdateEvent((sendCounters ? task.getCounters() : 
null),
-          task.getProgress(), task.getTaskStatistics());
+      TezCounters counters = null;
+      TaskStatistics stats = null;
+      float progress = 0;
+      if (task.hasInitialized()) {
+        progress = task.getProgress();
+        if (sendCounters) {
+          // send these potentially large objects at longer intervals to avoid 
overloading the AM
+          counters = task.getCounters();
+          stats = task.getTaskStatistics();
+        }
+      }
+      return new TaskStatusUpdateEvent(counters, progress, stats);
     }
 
     /**

Reply via email to