You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jd...@apache.org on 2016/04/26 19:54:06 UTC

[43/50] [abbrv] hive git commit: HIVE-13433. Fixes for additional incompatible changes in tez-0.8.3. (Siddharth Seth, reviewed by Prasanth Jayachandran)

HIVE-13433. Fixes for additional incompatible changes in tez-0.8.3. (Siddharth Seth, reviewed by Prasanth Jayachandran)


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

Branch: refs/heads/llap
Commit: 5d4b9c99e8d1315bea44b91fe476e6612ec829b6
Parents: f5665e3
Author: Siddharth Seth <ss...@apache.org>
Authored: Mon Apr 25 23:20:37 2016 -0700
Committer: Siddharth Seth <ss...@apache.org>
Committed: Mon Apr 25 23:20:37 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java   | 9 +++++----
 .../hive/llap/tezplugins/TestLlapTaskCommunicator.java      | 7 ++++++-
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/5d4b9c99/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java
----------------------------------------------------------------------
diff --git a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java
index bc9a209..a4f5d4d 100644
--- a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java
+++ b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java
@@ -71,6 +71,7 @@ import org.apache.tez.dag.api.TezUncheckedException;
 import org.apache.tez.dag.api.event.VertexStateUpdate;
 import org.apache.tez.dag.app.TezTaskCommunicatorImpl;
 import org.apache.tez.dag.records.TezTaskAttemptID;
+import org.apache.tez.runtime.api.TaskFailureType;
 import org.apache.tez.runtime.api.impl.TaskSpec;
 import org.apache.tez.runtime.api.impl.TezHeartbeatRequest;
 import org.apache.tez.runtime.api.impl.TezHeartbeatResponse;
@@ -114,7 +115,7 @@ public class LlapTaskCommunicator extends TezTaskCommunicatorImpl {
   public LlapTaskCommunicator(
       TaskCommunicatorContext taskCommunicatorContext) {
     super(taskCommunicatorContext);
-    Credentials credentials = taskCommunicatorContext.getCredentials();
+    Credentials credentials = taskCommunicatorContext.getAMCredentials();
     if (credentials != null) {
       @SuppressWarnings("unchecked")
       Token<LlapTokenIdentifier> llapToken =
@@ -313,7 +314,7 @@ public class LlapTaskCommunicator extends TezTaskCommunicatorImpl {
                   "Failed to run task: " + taskSpec.getTaskAttemptID() + " on containerId: " +
                       containerId, t);
               getContext()
-                  .taskFailed(taskSpec.getTaskAttemptID(), TaskAttemptEndReason.OTHER,
+                  .taskFailed(taskSpec.getTaskAttemptID(), TaskFailureType.NON_FATAL, TaskAttemptEndReason.OTHER,
                       t.toString());
             } else {
               // Exception from the RPC layer - communication failure, consider as KILLED / service down.
@@ -329,7 +330,7 @@ public class LlapTaskCommunicator extends TezTaskCommunicatorImpl {
                     "Failed to run task: " + taskSpec.getTaskAttemptID() + " on containerId: " +
                         containerId, t);
                 getContext()
-                    .taskFailed(taskSpec.getTaskAttemptID(), TaskAttemptEndReason.OTHER,
+                    .taskFailed(taskSpec.getTaskAttemptID(), TaskFailureType.NON_FATAL, TaskAttemptEndReason.OTHER,
                         t.getMessage());
               }
             }
@@ -534,7 +535,7 @@ public class LlapTaskCommunicator extends TezTaskCommunicatorImpl {
     currentQueryIdentifierProto = constructQueryIdentifierProto(newDagId);
     sourceStateTracker.resetState(newDagId);
     nodesForQuery.clear();
-    LOG.info("CurrentDagId set to: " + newDagId + ", name=" + getContext().getCurrentDagName());
+    LOG.info("CurrentDagId set to: " + newDagId + ", name=" + getContext().getCurrentDagInfo().getName());
     // TODO Is it possible for heartbeats to come in from lost tasks - those should be told to die, which
     // is likely already happening.
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/5d4b9c99/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java
----------------------------------------------------------------------
diff --git a/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java b/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java
index 1ee6a50..8e2d0ac 100644
--- a/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java
+++ b/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java
@@ -55,6 +55,7 @@ import org.apache.tez.dag.records.TezTaskID;
 import org.apache.tez.dag.records.TezVertexID;
 import org.apache.tez.runtime.api.impl.InputSpec;
 import org.apache.tez.runtime.api.impl.TaskSpec;
+import org.apache.tez.serviceplugins.api.DagInfo;
 import org.apache.tez.serviceplugins.api.TaskAttemptEndReason;
 import org.apache.tez.serviceplugins.api.TaskCommunicatorContext;
 import org.junit.Test;
@@ -278,9 +279,13 @@ public class TestLlapTaskCommunicator {
 
     public LlapTaskCommunicatorWrapperForTest(LlapProtocolClientProxy llapProxy) throws Exception {
       doReturn(appAttemptId).when(taskCommunicatorContext).getApplicationAttemptId();
-      doReturn(new Credentials()).when(taskCommunicatorContext).getCredentials();
+      doReturn(new Credentials()).when(taskCommunicatorContext).getAMCredentials();
       doReturn(userPayload).when(taskCommunicatorContext).getInitialUserPayload();
       doReturn(appId.toString()).when(taskCommunicatorContext).getCurrentAppIdentifier();
+      DagInfo dagInfo = mock(DagInfo.class);
+      doReturn(dagInfo).when(taskCommunicatorContext).getCurrentDagInfo();
+      doReturn(DAG_NAME).when(dagInfo).getName();
+      doReturn(new Credentials()).when(dagInfo).getCredentials();
       doReturn(new LinkedList<String>()).when(taskCommunicatorContext)
           .getInputVertexNames(any(String.class));