tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject [13/23] tez git commit: TEZ-2114. Tez UI: task/task attempt status is not available when its running. (Prakash Ramachandran via hitesh)
Date Wed, 18 Feb 2015 22:41:00 GMT
TEZ-2114. Tez UI: task/task attempt status is not available when its running. (Prakash Ramachandran
via hitesh)


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

Branch: refs/heads/TEZ-2003
Commit: ec7ad2069677a8cdf07500a174ca940c659b100e
Parents: 1653d18
Author: Hitesh Shah <hitesh@apache.org>
Authored: Tue Feb 17 12:38:32 2015 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Tue Feb 17 12:38:32 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../ats/HistoryEventTimelineConversion.java     |  4 +++
 .../ats/TestHistoryEventTimelineConversion.java |  4 +++
 .../scripts/components/dag-view/graph-view.js   |  2 +-
 .../controllers/dag-task-attempts-controller.js | 12 +++++--
 .../scripts/controllers/dag-view-controller.js  |  7 +++-
 .../app/scripts/controllers/dag_controller.js   |  4 +--
 .../scripts/controllers/dag_index_controller.js |  2 +-
 .../webapp/app/scripts/controllers/dag_tasks.js | 19 ++++++++--
 .../app/scripts/controllers/dag_vertices.js     |  8 +++--
 .../app/scripts/controllers/dags_controller.js  |  5 +--
 .../controllers/task_index_controller.js        | 12 ++++---
 .../task_task_attempts_controller.js            | 15 +++++---
 .../app/scripts/controllers/tasks_controller.js |  5 +--
 .../controllers/tez-app-dags-controller.js      |  5 +--
 .../scripts/controllers/vertex_controller.js    | 22 ++++++------
 .../controllers/vertex_index_controller.js      |  2 +-
 .../vertex_task_attempts_controller.js          | 14 +++++---
 .../controllers/vertex_tasks_controller.js      | 17 +++++++--
 .../src/main/webapp/app/scripts/helpers/misc.js | 37 +++++++++++++++++---
 tez-ui/src/main/webapp/app/scripts/router.js    |  3 ++
 .../main/webapp/app/templates/task/index.hbs    |  2 +-
 .../webapp/app/templates/taskAttempt/index.hbs  |  4 +--
 23 files changed, 151 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5458feb..cc481c2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -64,6 +64,7 @@ Release 0.6.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2114. Tez UI: task/task attempt status is not available when its running.
   TEZ-2112. Tez UI: fix offset calculation, add home button to breadcrumbs.
   TEZ-2038. TEZ-UI DAG is always running in tez-ui when the app is failed but no DAGFinishedEvent
is logged.
   TEZ-2102. Tez UI: DAG view has hidden edges, dragging DAG by holding vertex causes unintended
click.

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-plugins/tez-yarn-timeline-history-with-acls/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java
----------------------------------------------------------------------
diff --git a/tez-plugins/tez-yarn-timeline-history-with-acls/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java
b/tez-plugins/tez-yarn-timeline-history-with-acls/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java
index 9d85ee8..ca47b92 100644
--- a/tez-plugins/tez-yarn-timeline-history-with-acls/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java
+++ b/tez-plugins/tez-yarn-timeline-history-with-acls/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java
@@ -29,6 +29,8 @@ import org.apache.hadoop.yarn.api.records.timeline.TimelineEvent;
 import org.apache.tez.common.ATSConstants;
 import org.apache.tez.dag.api.EdgeManagerPluginDescriptor;
 import org.apache.tez.dag.api.TezUncheckedException;
+import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
+import org.apache.tez.dag.api.oldrecords.TaskState;
 import org.apache.tez.dag.history.HistoryEvent;
 import org.apache.tez.dag.history.HistoryEventType;
 import org.apache.tez.dag.history.events.AMLaunchedEvent;
@@ -435,6 +437,7 @@ public class HistoryEventTimelineConversion {
     atsEntity.addOtherInfo(ATSConstants.NODE_ID, event.getNodeId().toString());
     atsEntity.addOtherInfo(ATSConstants.NODE_HTTP_ADDRESS, event.getNodeHttpAddress());
     atsEntity.addOtherInfo(ATSConstants.CONTAINER_ID, event.getContainerId().toString());
+    atsEntity.addOtherInfo(ATSConstants.STATUS, TaskAttemptState.RUNNING.name());
 
     return atsEntity;
   }
@@ -497,6 +500,7 @@ public class HistoryEventTimelineConversion {
 
     atsEntity.addOtherInfo(ATSConstants.START_TIME, event.getStartTime());
     atsEntity.addOtherInfo(ATSConstants.SCHEDULED_TIME, event.getScheduledTime());
+    atsEntity.addOtherInfo(ATSConstants.STATUS, TaskState.SCHEDULED.name());
 
     return atsEntity;
   }

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
----------------------------------------------------------------------
diff --git a/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
b/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
index d4b9e69..6d713c5 100644
--- a/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
+++ b/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
@@ -705,6 +705,8 @@ public class TestHistoryEventTimelineConversion {
         ((Long)timelineEntity.getOtherInfo().get(ATSConstants.SCHEDULED_TIME)).longValue());
     Assert.assertEquals(startTime,
         ((Long)timelineEntity.getOtherInfo().get(ATSConstants.START_TIME)).longValue());
+    Assert.assertTrue(TaskState.SCHEDULED.name()
+        .equals(timelineEntity.getOtherInfo().get(ATSConstants.STATUS)));
   }
 
   @Test(timeout = 5000)
@@ -759,6 +761,8 @@ public class TestHistoryEventTimelineConversion {
         timelineEntity.getOtherInfo().get(ATSConstants.CONTAINER_ID));
     Assert.assertEquals("nodeHttpAddress",
         timelineEntity.getOtherInfo().get(ATSConstants.NODE_HTTP_ADDRESS));
+    Assert.assertTrue(TaskAttemptState.RUNNING.name()
+        .equals(timelineEntity.getOtherInfo().get(ATSConstants.STATUS)));
   }
 
   @Test(timeout = 5000)

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js b/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js
index 88c11f7..1bfb13a 100644
--- a/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js
+++ b/tez-ui/src/main/webapp/app/scripts/components/dag-view/graph-view.js
@@ -221,7 +221,7 @@ App.DagViewComponent.graphView = (function (){
    */
   function _addStatusBar(node, d) {
     var group = node.append('g'),
-        statusIcon = App.Helpers.misc.getStatusClassForEntity(d.get('data'));
+        statusIcon = App.Helpers.misc.getStatusClassForEntity(d.get('data.status'));
     group.attr('class', 'status-bar');
 
     group.append('foreignObject')

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
index d151af8..50df0bf 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
@@ -54,6 +54,7 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
 
   defaultColumnConfigs: function() {
     var that = this;
+    var dagStatus = this.get('controllers.dag.status');
     return [
       {
         id: 'taskId',
@@ -117,7 +118,7 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
         headerCellName: 'Status',
         filterID: 'status_filter',
         filterType: 'dropdown',
-        dropdownValues: App.Helpers.misc.taskStatusUIOptions,
+        dropdownValues: App.Helpers.misc.taskAttemptStatusUIOptions,
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">&nbsp;\
@@ -125,9 +126,14 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
             &nbsp;&nbsp;{{view.cellContent.status}}</span>')
         }),
         getCellContent: function(row) {
+          var status = App.Helpers.misc.getFixedupDisplayStatus(row.get('status'));
+          if (status == 'RUNNING' &&
+            App.Helpers.misc.isStatusInUnsuccessful(dagStatus)) {
+            status = 'KILLED';
+          }
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+            status: status,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(status)
           };
         }
       },

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js
index 9e73718..31753d1 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag-view-controller.js
@@ -74,7 +74,9 @@ App.DagViewController = Em.ObjectController.extend(App.PaginatedContentMixin,
Ap
   viewData: function () {
     var vertices = this.get('controllers.dag.vertices'),
         entities = this.get('entities'),
-        finalVertex;
+        finalVertex,
+        dagStatus = this.get('controllers.dag.status'),
+        needsStatusFixup = App.Helpers.misc.isStatusInUnsuccessful(dagStatus);
 
     entities = entities.reduce(function (obj, vertexData) {
       obj[vertexData.get('name')] = vertexData;
@@ -83,6 +85,9 @@ App.DagViewController = Em.ObjectController.extend(App.PaginatedContentMixin,
Ap
 
     vertices.forEach(function (vertex) {
       vertex.data = entities[vertex.vertexName];
+      if (needsStatusFixup && vertex.data.get('status') == 'RUNNING') {
+        vertex.data.set('status', 'KILLED');
+      }
     });
 
     return {

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
index 210e673..c8d9c87 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js
@@ -45,11 +45,11 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
           dag.set('yarnAppState', appState);
         }
         dag.set('status', App.Helpers.misc.getRealStatus(dag.get('status'), app.get('appState'),
app.get('finalAppStatus')));
-      });
+      }).catch(function(){});
     var tezAppLoader = this.store.find('tezApp', 'tez_' + applicationId)
       .then(function(app){
         dag.set('tezApp', app);
-      });
+      }).catch(function(){});
 
     loaders.push(appDetailLoader);
 

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js
index fed28c7..3261787 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_index_controller.js
@@ -21,7 +21,7 @@ App.DagIndexController = Em.ObjectController.extend({
 	controllerName: 'DagIndexController',
 
 	taskIconStatus: function() {
-		return App.Helpers.misc.getStatusClassForEntity(this.get('model'));
+		return App.Helpers.misc.getStatusClassForEntity(this.get('model.status'));
 	}.property('id', 'status', 'counterGroups'),
 
   progressStr: function() {

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
index 849b1db..93b9234 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
@@ -57,9 +57,21 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
       .fmt(App.env.timelineBaseUrl);
 
     store.unloadAll(childEntityType);
-    store.findQuery(childEntityType, this.getFilterProperties()).then(function(entities){
+    store.findQuery(childEntityType, this.getFilterProperties())
+      .then(function(entities){
+
       var pivotLoaders = [];
+      var dagStatus = that.get('controllers.dag.status');
       entities.forEach(function (task) {
+        var taskStatus = App.Helpers.misc
+          .getFixedupDisplayStatus(task.get('status'));
+        if (taskStatus == 'RUNNING' &&
+          App.Helpers.misc.isStatusInUnsuccessful(dagStatus)) {
+          taskStatus = 'KILLED'
+        }
+        if (taskStatus != task.get('status')) {
+          task.set('status', taskStatus);
+        }
         var taskAttemptId = task.get('successfulAttemptId') ||
             task.get('attempts.lastObject');
         if (!!taskAttemptId) {
@@ -158,9 +170,10 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
             &nbsp;&nbsp;{{view.cellContent.status}}</span>')
         }),
         getCellContent: function(row) {
+          var status = row.get('status');
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+            status: status,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(status)
           };
         }
       },

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
index a373220..f63524a 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js
@@ -176,13 +176,15 @@ App.DagVerticesController = Em.ObjectController.extend(App.PaginatedContentMixin
             {{#if view.cellContent.progress}} {{bs-badge content=view.cellContent.progress}}{{/if}}</span>')
         }),
         getCellContent: function(row) {
-          var pct;
+          var pct,
+              vertexStatus = row.get('status');
           if (Ember.typeOf(row.get('progress')) === 'number') {
             pct = App.Helpers.number.fractionToPercentage(row.get('progress'));
           }
+
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row),
+            status: vertexStatus,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(vertexStatus),
             progress: pct
           };
         }

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
index 53d9eeb..35a0ecc 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
@@ -179,9 +179,10 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin,
App.C
           if (Ember.typeOf(row.get('progress')) === 'number') {
             pct = App.Helpers.number.fractionToPercentage(row.get('progress'));
           }
+          var dagStatus = row.get('status');
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row),
+            status: dagStatus,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(dagStatus),
             progress: pct
           };
         }

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js
index fa36314..7f3eeb3 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_index_controller.js
@@ -18,10 +18,14 @@
 
  //TODO: watch individual counters.
 App.TaskIndexController = Em.ObjectController.extend({
-	controllerName: 'TaskIndexController',
+  controllerName: 'TaskIndexController',
 
-	taskIconStatus: function() {
-		return App.Helpers.misc.getStatusClassForEntity(this.get('model'));
-	}.property('id', 'status', 'counterGroups'),
+  taskStatus: function() {
+    return App.Helpers.misc.getFixedupDisplayStatus(this.get('model.status'));
+  }.property('id', 'status'),
+
+  taskIconStatus: function() {
+    return App.Helpers.misc.getStatusClassForEntity(this.get('taskStatus'));
+  }.property('id', 'status', 'counterGroups'),
 
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
index 84de0a7..0749e00 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
@@ -161,7 +161,7 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
         headerCellName: 'Status',
         filterID: 'status_filter',
         filterType: 'dropdown',
-        dropdownValues: App.Helpers.misc.taskStatusUIOptions,
+        dropdownValues: App.Helpers.misc.taskAttemptStatusUIOptions,
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">&nbsp;\
@@ -169,9 +169,10 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
             &nbsp;&nbsp;{{view.cellContent.status}}</span>')
         }),
         getCellContent: function(row) {
+          var status = App.Helpers.misc.getFixedupDisplayStatus(row.get('status'));
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+            status: status,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(status)
           };
         }
       },
@@ -255,8 +256,12 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
 App.TaskAttemptIndexController = Em.ObjectController.extend({
   controllerName: 'TaskAttemptIndexController',
 
-  taskIconStatus: function() {
-    return App.Helpers.misc.getStatusClassForEntity(this.get('model'));
+  taskAttemptStatus: function() {
+    return App.Helpers.misc.getFixedupDisplayStatus(this.get('status'));
+  }.property('id', 'status'),
+
+  taskAttemptIconStatus: function() {
+    return App.Helpers.misc.getStatusClassForEntity(this.get('taskAttemptStatus'));
   }.property('id', 'status', 'counterGroups'),
 
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/tasks_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/tasks_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/tasks_controller.js
index 1bc45b9..35e1fd3 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/tasks_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/tasks_controller.js
@@ -88,9 +88,10 @@ App.TasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
App.
             &nbsp;&nbsp;{{view.cellContent.status}}</span>')
         }),
         getCellContent: function(row) {
+          var taskStatus = row.get('status');
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+            status: taskStatus,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(taskStatus)
           };
         }
       }

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
index 79ae56b..151438e 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
@@ -158,9 +158,10 @@ App.TezAppDagsController = Em.ObjectController.extend(App.PaginatedContentMixin,
           if (Ember.typeOf(row.get('progress')) === 'number') {
             pct = App.Helpers.number.fractionToPercentage(row.get('progress'));
           }
+          var dagStatus = row.get('status');
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row),
+            status: dagStatus,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(dagStatus),
             progress: pct
           };
         }

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js
index f6893b9..89a99a9 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js
@@ -23,19 +23,19 @@ App.VertexController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
 
   loading: true,
 
-  updateLoading: function() {
+  loadAdditional: function(vertex) {
     var loaders = [],
       that = this,
-      applicationId = this.get('applicationId');
+      applicationId = vertex.get('applicationId');
 
-    if (this.get('status') == 'RUNNING') {
-      var vertexIdx = that.get('id').split('_').splice(-1).pop();
+    if (vertex.get('status') == 'RUNNING') {
+      var vertexIdx = vertex.get('id').split('_').splice(-1).pop();
       var progressLoader = this.store.find('vertexProgress', vertexIdx, {
         appId: applicationId,
-        dagIdx: that.get('dagIdx')
+        dagIdx: vertex.get('dagIdx')
       }).then(function(vertexProgressInfo) {
         if (vertexProgressInfo) {
-          that.set('progress', vertexProgressInfo.get('progress'));
+          vertex.set('progress', vertexProgressInfo.get('progress'));
         }
       }).catch(function(error) {
         Em.Logger.error("Failed to fetch vertexProgress" + error)
@@ -46,16 +46,18 @@ App.VertexController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
     var appDetailFetcher = that.store.find('appDetail', applicationId).then(function(appDetail)
{
       var appState = appDetail.get('appState');
       if (appState) {
-        that.set('yarnAppState', appState);
+        vertex.set('yarnAppState', appState);
       }
-      that.set('status', App.Helpers.misc.getRealStatus(that.get('status'), appDetail.get('appState'),
+      vertex.set('status', App.Helpers.misc.getRealStatus(vertex.get('status'), appDetail.get('appState'),
         appDetail.get('finalAppStatus')));
-    });
+    }).catch(function(){});
     loaders.push(appDetailFetcher);
     Em.RSVP.allSettled(loaders).then(function(){
       that.set('loading', false);
     });
-  }.observes('content'),
+
+    return Em.RSVP.all(loaders);
+  },
 
   childDisplayViews: [
     Ember.Object.create({title: 'Details', linkTo: 'vertex.index'}),

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/vertex_index_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_index_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_index_controller.js
index 8c53db2..f175ed1 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_index_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_index_controller.js
@@ -21,7 +21,7 @@ App.VertexIndexController = Em.ObjectController.extend({
 
   //TODO: TEZ-1705 : Create a parent class and move this function there to avoid duplication.
   iconStatus: function() {
-    return App.Helpers.misc.getStatusClassForEntity(this.get('model'));
+    return App.Helpers.misc.getStatusClassForEntity(this.get('model.status'));
   }.property('id', 'status', 'counterGroups'),
 
   progressStr: function() {

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
index e6ee417..5f51de4 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
@@ -54,7 +54,8 @@ App.VertexTaskAttemptsController = Em.ObjectController.extend(App.PaginatedConte
   },
 
   defaultColumnConfigs: function() {
-    var that = this;
+    var that = this,
+        vertexStatus = that.get('controllers.vertex.status');
     return [
       {
         id: 'taskId',
@@ -118,7 +119,7 @@ App.VertexTaskAttemptsController = Em.ObjectController.extend(App.PaginatedConte
         headerCellName: 'Status',
         filterID: 'status_filter',
         filterType: 'dropdown',
-        dropdownValues: App.Helpers.misc.taskStatusUIOptions,
+        dropdownValues: App.Helpers.misc.taskAttemptStatusUIOptions,
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">&nbsp;\
@@ -126,9 +127,14 @@ App.VertexTaskAttemptsController = Em.ObjectController.extend(App.PaginatedConte
             &nbsp;&nbsp;{{view.cellContent.status}}</span>')
         }),
         getCellContent: function(row) {
+          var status = App.Helpers.misc.getFixedupDisplayStatus(row.get('status'));
+          if (status == 'RUNNING' &&
+            App.Helpers.misc.isStatusInUnsuccessful(vertexStatus)) {
+            status = 'KILLED'
+          }
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+            status: status,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(status)
           };
         }
       },

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
index 90340ff..9b76aee 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
@@ -50,8 +50,18 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
 
     store.unloadAll(childEntityType);
     store.findQuery(childEntityType, this.getFilterProperties()).then(function(entities){
-      var pivotLoaders = [];
+      var pivotLoaders = [],
+          vertexStatus = that.get('controllers.vertex.status');
       entities.forEach(function (task) {
+        var taskStatus = App.Helpers.misc
+          .getFixedupDisplayStatus(task.get('status'));
+        if (taskStatus == 'RUNNING' &&
+          App.Helpers.misc.isStatusInUnsuccessful(vertexStatus)) {
+          taskStatus = 'KILLED';
+        }
+        if (taskStatus != task.get('status')) {
+          task.set('status', taskStatus);
+        }
         var taskAttemptId = task.get('successfulAttemptId') || task.get('attempts.lastObject');
         if (!!taskAttemptId) {
           // Pivot attempt selection logic
@@ -143,9 +153,10 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
             &nbsp;&nbsp;{{view.cellContent.status}}</span>')
         }),
         getCellContent: function(row) {
+          var status = row.get('status');
           return {
-            status: row.get('status'),
-            statusIcon: App.Helpers.misc.getStatusClassForEntity(row)
+            status: status,
+            statusIcon: App.Helpers.misc.getStatusClassForEntity(status)
           };
         }
       },

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
index 4872881..187f800 100644
--- a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
+++ b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
@@ -16,11 +16,10 @@
  */
 
 App.Helpers.misc = {
-  getStatusClassForEntity: function(dag) {
-    if(!dag) return '';
+  getStatusClassForEntity: function(status, hasFailedTasks) {
+    if(!status) return '';
 
-    var st = dag.get('status');
-    switch(st) {
+    switch(status) {
       case 'FAILED':
         return 'failed';
       case 'KILLED':
@@ -30,6 +29,11 @@ App.Helpers.misc = {
       case 'ERROR':
         return 'error';
       case 'SUCCEEDED':
+        if (!!hasFailedTasks) {
+          return 'warning';
+        }
+        /*
+        TODO: TEZ-2113
         var counterGroups = dag.get('counterGroups');
         var numFailedTasks = this.getCounterValueForDag(counterGroups,
           dag.get('id'), 'org.apache.tez.common.counters.DAGCounter',
@@ -38,7 +42,7 @@ App.Helpers.misc = {
 
         if (numFailedTasks > 0) {
           return 'warning';
-        }
+        }*/
 
         return 'success';
       case 'UNDEFINED':
@@ -193,6 +197,21 @@ App.Helpers.misc = {
     return path;
   },
 
+  // Tez originally shows the status for task and task attempt only on
+  // completion. this causes confusion to the user as the status would not be
+  // displayed. so if status is not set return the status as 'RUNNING'. We do
+  // not diffentiate between running and scheduled.
+  getFixedupDisplayStatus: function(originalStatus) {
+    // if status is not set show it as running, since originally the task did
+    // not have a status set on scheduled/running.
+    // with the new version we set the status of task as scheduled and that of
+    // task attempt as running
+    if (!originalStatus || originalStatus == 'SCHEDULED') {
+      originalStatus = 'RUNNING';
+    }
+    return originalStatus;
+  },
+
   /**
    * Merge content of obj2 into obj2, array elements will be concated.
    * @param obj1 {Object}
@@ -233,6 +252,14 @@ App.Helpers.misc = {
 
   taskStatusUIOptions: [
     { label: 'All', id: null },
+    { label: 'Running', id: 'SCHEDULED' },
+    { label: 'Succeeded', id: 'SUCCEEDED' },
+    { label: 'Failed', id: 'FAILED' },
+    { label: 'Killed', id: 'KILLED' },
+  ],
+
+  taskAttemptStatusUIOptions: [
+    { label: 'All', id: null },
     { label: 'Running', id: 'RUNNING' },
     { label: 'Succeeded', id: 'SUCCEEDED' },
     { label: 'Failed', id: 'FAILED' },

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/scripts/router.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/router.js b/tez-ui/src/main/webapp/app/scripts/router.js
index efb52d7..0af1d05 100644
--- a/tez-ui/src/main/webapp/app/scripts/router.js
+++ b/tez-ui/src/main/webapp/app/scripts/router.js
@@ -187,6 +187,9 @@ App.VertexRoute = Em.Route.extend({
   model: function(params) {
     return this.store.find('vertex', params.vertex_id);
   },
+  afterModel: function(model) {
+    return this.controllerFor('vertex').loadAdditional(model);
+  },
   setupController: setupControllerFactory('Vertex: %@ (%@)', 'name', 'id')
 });
 

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/templates/task/index.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/task/index.hbs b/tez-ui/src/main/webapp/app/templates/task/index.hbs
index df4a5b1..6826e7b 100644
--- a/tez-ui/src/main/webapp/app/templates/task/index.hbs
+++ b/tez-ui/src/main/webapp/app/templates/task/index.hbs
@@ -23,7 +23,7 @@
 				<tr>
 					<td>{{t 'common.status'}}</td>
 					<td>
-						{{status}}
+						{{taskStatus}}
 						<i {{bind-attr class=':task-status taskIconStatus'}}></i>
 					</td>
 				</tr>

http://git-wip-us.apache.org/repos/asf/tez/blob/ec7ad206/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs
index 92e0f13..738b636 100644
--- a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs
+++ b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs
@@ -23,8 +23,8 @@
 				<tr>
 					<td>{{t 'common.status'}}</td>
 					<td>
-						{{status}}
-						<i {{bind-attr class=':task-status taskIconStatus'}}></i>
+						{{taskAttemptStatus}}
+						<i {{bind-attr class=':task-status taskAttemptIconStatus'}}></i>
 					</td>
 				</tr>
 				<tr>


Mime
View raw message