hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jd...@apache.org
Subject [21/50] [abbrv] hive git commit: HIVE-13319 : Fix passing external handles in task display (Rajat Khandelwal, reviewed by amareshwari)
Date Mon, 04 Apr 2016 20:36:56 GMT
HIVE-13319 : Fix passing external handles in task display (Rajat Khandelwal, reviewed by amareshwari)


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

Branch: refs/heads/llap
Commit: 41a30b59de35601211657b65a20b9d418958fb58
Parents: 69cfd35
Author: Rajat Khandelwal <prongs@apache.org>
Authored: Mon Mar 28 09:45:43 2016 +0530
Committer: Amareshwari Sriramadasu <amareshwari@apache.org>
Committed: Mon Mar 28 09:45:43 2016 +0530

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java  | 11 +++++++----
 .../test/org/apache/hive/service/cli/CLIServiceTest.java |  8 ++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/41a30b59/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java b/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
index 467dab6..d582bc0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
@@ -72,7 +72,7 @@ public class QueryDisplay {
     private Long endTime;
 
     private String taskId;
-    private String taskExternalHandle;
+    private String externalHandle;
 
     public Task.TaskState taskState;
     private StageType taskType;
@@ -85,7 +85,7 @@ public class QueryDisplay {
     }
     public TaskDisplay(Task task) {
       taskId = task.getId();
-      taskExternalHandle = task.getExternalHandle();
+      externalHandle = task.getExternalHandle();
       taskType = task.getType();
       name = task.getName();
       requireLock = task.requireLock();
@@ -150,12 +150,15 @@ public class QueryDisplay {
     }
 
     public synchronized String getExternalHandle() {
-      return taskExternalHandle;
+      return externalHandle;
     }
 
     public synchronized <T extends Serializable> void updateStatus(Task<T> tTask)
{
       this.taskState = tTask.getTaskState();
-      switch(taskState) {
+      if (externalHandle == null && tTask.getExternalHandle() != null) {
+        this.externalHandle = tTask.getExternalHandle();
+      }
+      switch (taskState) {
         case RUNNING:
           beginTime = System.currentTimeMillis();
           break;

http://git-wip-us.apache.org/repos/asf/hive/blob/41a30b59/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
----------------------------------------------------------------------
diff --git a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
index e145eb4..698b13d 100644
--- a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
+++ b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
@@ -45,6 +45,7 @@ import org.codehaus.jackson.type.TypeReference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.plan.api.StageType;
 import org.apache.hadoop.hive.ql.session.SessionState;
 
 import org.junit.After;
@@ -676,6 +677,7 @@ public abstract class CLIServiceTest {
       switch (taskDisplay.taskState) {
         case INITIALIZED:
         case QUEUED:
+          assertNull(taskDisplay.getExternalHandle());
           assertNull(taskDisplay.getBeginTime());
           assertNull(taskDisplay.getEndTime());
           assertNull(taskDisplay.getElapsedTime());
@@ -683,6 +685,9 @@ public abstract class CLIServiceTest {
           assertNull(taskDisplay.getReturnValue());
           break;
         case RUNNING:
+          if (taskDisplay.getTaskType() == StageType.MAPRED || taskDisplay.getTaskType()
== StageType.MAPREDLOCAL) {
+            assertNotNull(taskDisplay.getExternalHandle());
+          }
           assertNotNull(taskDisplay.getBeginTime());
           assertNull(taskDisplay.getEndTime());
           assertNotNull(taskDisplay.getElapsedTime());
@@ -690,6 +695,9 @@ public abstract class CLIServiceTest {
           assertNull(taskDisplay.getReturnValue());
           break;
         case FINISHED:
+          if (taskDisplay.getTaskType() == StageType.MAPRED || taskDisplay.getTaskType()
== StageType.MAPREDLOCAL) {
+            assertNotNull(taskDisplay.getExternalHandle());
+          }
           assertNotNull(taskDisplay.getBeginTime());
           assertNotNull(taskDisplay.getEndTime());
           assertNotNull(taskDisplay.getElapsedTime());


Mime
View raw message