tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject [04/35] tez git commit: TEZ-2061. Tez UI: vertex id column and filter on tasks page should be changed to vertex name (pramachandran)
Date Tue, 07 Apr 2015 20:12:22 GMT
TEZ-2061. Tez UI: vertex id column and filter on tasks page should be changed to vertex name
(pramachandran)


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

Branch: refs/heads/TEZ-2003
Commit: 1c9b2fdaf032550a905e0f7e1ffdb567329fc166
Parents: 505febd
Author: Prakash Ramachandran <pramachandran@hortonworks.com>
Authored: Mon Mar 30 17:42:16 2015 +0530
Committer: Prakash Ramachandran <pramachandran@hortonworks.com>
Committed: Mon Mar 30 17:42:16 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../controllers/dag-task-attempts-controller.js | 28 +++++++++++++++---
 .../webapp/app/scripts/controllers/dag_tasks.js | 31 ++++++++++++--------
 .../app/scripts/controllers/tasks_controller.js | 14 ++++++---
 .../src/main/webapp/app/scripts/helpers/misc.js | 12 ++++++++
 .../app/scripts/models/TimelineRestAdapter.js   | 10 +++++++
 .../src/main/webapp/app/scripts/models/dag.js   |  1 +
 7 files changed, 77 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3c859c6..e2d3c2b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -91,6 +91,7 @@ Release 0.6.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2061. Tez UI: vertex id column and filter on tasks page should be changed to vertex
name
   TEZ-2242. Refactor ShuffleVertexManager code
   TEZ-2205. Tez still tries to post to ATS when yarn.timeline-service.enabled=false.
   TEZ-2047. Build fails against hadoop-2.2 post TEZ-2018

http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/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 e2f5fad..6617c10 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
@@ -25,14 +25,24 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
 
   queryParams: {
     status_filter: 'status',
+    vertex_name_filter: 'vertex_name',
   },
   status_filter: null,
+  vertex_name_filter: null,
 
   loadData: function() {
+    var primaryFilter = {
+      TEZ_DAG_ID : this.get('controllers.dag.id')
+    };
+    if (!!this.vertex_name_filter) {
+      var vertexIdMap = this.get('controllers.dag.vertexIdToNameMap');
+      var vertexId = App.Helpers.misc.getVertexIdFromName(vertexIdMap, this.vertex_name_filter)
+        || 'unknown';
+      primaryFilter = { TEZ_VERTEX_ID : vertexId };
+    }
+
     var filters = {
-      primary: {
-        TEZ_DAG_ID: this.get('controllers.dag.id')
-      },
+      primary: primaryFilter,
       secondary: {
         status: this.status_filter
       }
@@ -95,7 +105,8 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
   },
 
   defaultColumnConfigs: function() {
-    var that = this;
+    var that = this,
+        vertexIdToNameMap = this.get('controllers.dag.vertexIdToNameMap') || {};
     return [
       {
         id: 'taskId',
@@ -130,6 +141,15 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
         }
       },
       {
+        id: 'vertexName',
+        headerCellName: 'Vertex Name',
+        filterID: 'vertex_name_filter',
+        getCellContent: function(row) {
+          var vertexId = row.get('vertexID');
+          return vertexIdToNameMap[vertexId] || vertexId;
+        }
+      },
+      {
         id: 'startTime',
         headerCellName: 'Start Time',
         getCellContent: function(row) {

http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/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 17efab7..519f06d 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
@@ -26,17 +26,20 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
 
   queryParams: {
     status_filter: 'status',
-    vertex_id_filter: 'vertex_id',
+    vertex_name_filter: 'vertex_name',
   },
   status_filter: null,
-  vertex_id_filter: null,
+  vertex_name_filter: null,
 
   loadData: function() {
-    var primaryFilter;
-    if (!!this.vertex_id_filter) {
-      primaryFilter = { TEZ_VERTEX_ID : this.vertex_id_filter };
-    } else {
-      primaryFilter = { TEZ_DAG_ID : this.get('controllers.dag.id') };
+    var primaryFilter = {
+      TEZ_DAG_ID : this.get('controllers.dag.id')
+    };
+    if (!!this.vertex_name_filter) {
+      var vertexIdMap = this.get('controllers.dag.vertexIdToNameMap');
+      var vertexId = App.Helpers.misc.getVertexIdFromName(vertexIdMap, this.vertex_name_filter)
+        || 'unknown';
+      primaryFilter = { TEZ_VERTEX_ID : vertexId };
     }
 
     var filters = {
@@ -127,7 +130,8 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
   },
 
   defaultColumnConfigs: function() {
-    var that = this;
+    var that = this,
+        vertexIdToNameMap = this.get('controllers.dag.vertexIdToNameMap') || {};
     return [
       {
         id: 'id',
@@ -146,10 +150,13 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
         }
       },
       {
-        id: 'vertexID',
-        headerCellName: 'Vertex ID',
-        filterID: 'vertex_id_filter',
-        contentPath: 'vertexID'
+        id: 'vertexName',
+        headerCellName: 'Vertex Name',
+        filterID: 'vertex_name_filter',
+        getCellContent: function(row) {
+          var vertexId = row.get('vertexID');
+          return vertexIdToNameMap[vertexId] || vertexId;
+        }
       },
       {
         id: 'startTime',

http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/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 9878eda..548b516 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
@@ -33,6 +33,7 @@ App.TasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
App.
   },
 
   parentName: 'Loading...', // So that a proper message is displayed
+  vertexIdToNameMap: {},
   parentType: null,
   parentID: null,
   status_filter: null,
@@ -53,11 +54,12 @@ App.TasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
App.
     return this.store.find('dag', this.get('parentID')).
       then(function (parent) {
         that.set('parentName', parent.get('name'));
+        that.set('vertexIdToNameMap', parent.get('vertexIdToNameMap') || {});
       });
   },
 
   defaultColumnConfigs: function() {
-
+    var that = this;
     return [
       {
         id: 'taskId',
@@ -69,9 +71,13 @@ App.TasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
App.
         })
       },
       {
-        id: 'vertexId',
-        headerCellName: 'Vertex ID',
-        contentPath: 'vertexID'
+        id: 'vertexName',
+        headerCellName: 'Vertex Name',
+        getCellContent: function(row) {
+          var vertexId = row.get('vertexID'),
+              vertexIdToNameMap = that.get('vertexIdToNameMap');
+          return vertexIdToNameMap[vertexId] || vertexId;
+        }
       },
       {
         id: 'submissionTime',

http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/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 bba2286..608f60e 100644
--- a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
+++ b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
@@ -245,6 +245,18 @@ App.Helpers.misc = {
     return taskID.indexOf(idPrefix) == 0 ? taskID.substr(idPrefix.length) : id;
   },
 
+  getVertexIdFromName: function(idToNameMap, vertexName) {
+    idToNameMap = idToNameMap || {};
+    var vertexId = undefined;
+    $.each(idToNameMap, function(id, name) {
+      if (name === vertexName) {
+        vertexId = id;
+        return false;
+      }
+    });
+    return vertexId;
+  },
+
   /**
    * Remove the specific record from store
    * @param store {DS.Store}

http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
index cc167df..e14a724 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
@@ -112,6 +112,16 @@ var timelineJsonToDagMap = {
   vertices: 'otherinfo.dagPlan.vertices',
   edges: 'otherinfo.dagPlan.edges',
   vertexGroups: 'otherinfo.dagPlan.vertexGroups',
+  vertexIdToNameMap: {
+    custom: function(source) {
+      var nameToIdMap = Em.get(source, 'otherinfo.vertexNameIdMapping') || {};
+      var idToNameMap = {};
+      $.each(nameToIdMap, function(vertexName, vertexId) {
+        idToNameMap[vertexId] = vertexName;
+      });
+      return idToNameMap;
+    }
+  },
 
   counterGroups: 'counterGroups'
 };

http://git-wip-us.apache.org/repos/asf/tez/blob/1c9b2fda/tez-ui/src/main/webapp/app/scripts/models/dag.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/models/dag.js b/tez-ui/src/main/webapp/app/scripts/models/dag.js
index 31ea0de..b86578c 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/dag.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/dag.js
@@ -56,6 +56,7 @@ App.Dag = App.AbstractEntity.extend({
   vertices: DS.attr('array'), // Serialize when required
   edges: DS.attr('array'), // Serialize when required
   vertexGroups: DS.attr('array'),
+  vertexIdToNameMap: DS.attr('array'),
 
   counterGroups: DS.hasMany('counterGroup', { inverse: 'parent' })
 });


Mime
View raw message