You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by hi...@apache.org on 2015/02/27 23:24:40 UTC
tez git commit: TEZ-2158. TEZ UI: Display dag/vertex names,
and task/attempt index in breadcrumb. (Sreenath Somarajapuram via
hitesh)
Repository: tez
Updated Branches:
refs/heads/master 6dc367e83 -> 0a81409fe
TEZ-2158. TEZ UI: Display dag/vertex names, and task/attempt index in breadcrumb. (Sreenath Somarajapuram via hitesh)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/0a81409f
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/0a81409f
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/0a81409f
Branch: refs/heads/master
Commit: 0a81409fe952e902868d8bc96b33a6f776565b68
Parents: 6dc367e
Author: Hitesh Shah <hi...@apache.org>
Authored: Fri Feb 27 14:24:16 2015 -0800
Committer: Hitesh Shah <hi...@apache.org>
Committed: Fri Feb 27 14:24:16 2015 -0800
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../controllers/task_attempt_controller.js | 51 ++++++++++++++++----
.../app/scripts/controllers/task_controller.js | 47 +++++++++++++-----
.../app/scripts/controllers/tasks_controller.js | 9 ++++
.../scripts/controllers/vertex_controller.js | 6 +++
.../src/main/webapp/app/scripts/helpers/misc.js | 5 ++
.../src/main/webapp/app/scripts/models/dag.js | 9 +++-
.../webapp/app/scripts/models/task_attempt.js | 7 ++-
tez-ui/src/main/webapp/app/scripts/router.js | 15 +++++-
tez-ui/src/main/webapp/app/templates/dag.hbs | 2 +-
.../src/main/webapp/app/templates/dag/index.hbs | 4 ++
tez-ui/src/main/webapp/app/templates/task.hbs | 6 +--
.../main/webapp/app/templates/task_attempt.hbs | 8 +--
tez-ui/src/main/webapp/app/templates/tasks.hbs | 2 +-
.../src/main/webapp/app/templates/tez-app.hbs | 2 +-
tez-ui/src/main/webapp/app/templates/vertex.hbs | 4 +-
16 files changed, 142 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e46399d..fd40fa1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -74,6 +74,7 @@ Release 0.6.1: Unreleased
INCOMPATIBLE CHANGES
ALL CHANGES:
+ TEZ-2158. TEZ UI: Display dag/vertex names, and task/attempt index in breadcrumb.
TEZ-2160. Tez UI: App tracking URL should support navigation back.
TEZ-2147. Swimlanes: Improved tooltip
TEZ-2142. TEZ UI: Breadcrumb border color looks out of place in wrapped mode.
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js
index b82d9ec..ad8dccd 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_attempt_controller.js
@@ -17,19 +17,50 @@
*/
App.TaskAttemptController = Em.ObjectController.extend(App.Helpers.DisplayHelper, {
- controllerName: 'TaskAttemptController',
+ controllerName: 'TaskAttemptController',
- pageTitle: 'TaskAttempt',
+ pageTitle: 'TaskAttempt',
- loading: true,
+ loading: true,
- updateLoading: function() {
- this.set('loading', false);
- }.observes('content'),
+ loadAdditional: function(attempt) {
+ var that = this;
- childDisplayViews: [
- Ember.Object.create({title: 'TaskAttempt Details', linkTo: 'taskAttempt.index'}),
- Ember.Object.create({title: 'TaskAttempt Counters', linkTo: 'taskAttempt.counters'}),
- ],
+ var dagLoader = this.store.find('dag', attempt.get('dagID'));
+ var vertexLoader = this.store.find('vertex', attempt.get('vertexID'));
+ var taskLoader = this.store.find('task', attempt.get('taskID'));
+
+ var allLoaders = Em.RSVP.hash({
+ dag: dagLoader,
+ vertex: vertexLoader,
+ task: taskLoader
+ });
+ allLoaders.then(function(results) {
+ attempt.set('task', results.task);
+ attempt.set('task.vertex', results.vertex);
+ attempt.set('task.vertex.dag', results.dag);
+ }).finally(function() {
+ that.set('loading', false);
+ });
+
+ return allLoaders;
+ },
+
+ taskIndex: function() {
+ return App.Helpers.misc.getTaskIndex(this.get('dagID'), this.get('taskID'));
+ }.property('taskID', 'dagID'),
+
+ vertexName: function() {
+ return this.get('task.vertex.name') || this.get('vertexID');
+ }.property('task.vertex.name', 'vertexID'),
+
+ dagName: function() {
+ return this.get('task.vertex.dag.name') || this.get('dagID');
+ }.property('task.vertex.dag.name', 'dagID'),
+
+ childDisplayViews: [
+ Ember.Object.create({title: 'TaskAttempt Details', linkTo: 'taskAttempt.index'}),
+ Ember.Object.create({title: 'TaskAttempt Counters', linkTo: 'taskAttempt.counters'}),
+ ],
});
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js
index 0a312e7..7f5afb1 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js
@@ -17,20 +17,45 @@
*/
App.TaskController = Em.ObjectController.extend(App.Helpers.DisplayHelper, App.ModelRefreshMixin, {
- controllerName: 'TaskController',
+ controllerName: 'TaskController',
- pageTitle: 'Task',
+ pageTitle: 'Task',
- loading: true,
+ loading: true,
- updateLoading: function() {
- this.set('loading', false);
- }.observes('content'),
+ loadAdditional: function(task) {
+ var that = this;
- childDisplayViews: [
- Ember.Object.create({title: 'Task Details', linkTo: 'task.index'}),
- Ember.Object.create({title: 'Task Counters', linkTo: 'task.counters'}),
- Ember.Object.create({title: 'Task Attempts', linkTo: 'task.attempts'}),
- ],
+ var dagLoader = this.store.find('dag', task.get('dagID'));
+ var vertexLoader = this.store.find('vertex', task.get('vertexID'));
+
+ var allLoaders = Em.RSVP.hash({
+ dag: dagLoader,
+ vertex: vertexLoader
+ });
+
+ allLoaders.then(function(results) {
+ task.set('vertex', results.vertex);
+ task.set('vertex.dag', results.dag);
+ }).finally(function() {
+ that.set('loading', false);
+ });
+
+ return allLoaders;
+ },
+
+ vertexName: function() {
+ return this.get('vertex.name') || this.get('vertexID');
+ }.property('vertex.name', 'vertexID'),
+
+ dagName: function() {
+ return this.get('vertex.dag.name') || this.get('dagID');
+ }.property('vertex.dag.name', 'dagID'),
+
+ childDisplayViews: [
+ Ember.Object.create({title: 'Task Details', linkTo: 'task.index'}),
+ Ember.Object.create({title: 'Task Counters', linkTo: 'task.counters'}),
+ Ember.Object.create({title: 'Task Attempts', linkTo: 'task.attempts'}),
+ ],
});
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/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 35e1fd3..9878eda 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
@@ -32,6 +32,7 @@ App.TasksController = Em.ObjectController.extend(App.PaginatedContentMixin, App.
status_filter: 'status'
},
+ parentName: 'Loading...', // So that a proper message is displayed
parentType: null,
parentID: null,
status_filter: null,
@@ -47,6 +48,14 @@ App.TasksController = Em.ObjectController.extend(App.PaginatedContentMixin, App.
this.setFiltersAndLoadEntities(filters);
},
+ loadAdditional: function (loader) {
+ var that = this;
+ return this.store.find('dag', this.get('parentID')).
+ then(function (parent) {
+ that.set('parentName', parent.get('name'));
+ });
+ },
+
defaultColumnConfigs: function() {
return [
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/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 ce7737b..ad67842 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
@@ -54,6 +54,12 @@ App.VertexController = Em.ObjectController.extend(App.Helpers.DisplayHelper, App
appDetail.get('finalAppStatus')));
}).catch(function(){});
loaders.push(appDetailFetcher);
+
+ var dagFetcher = that.store.find('dag', vertex.get('dagID')).then(function (dag) {
+ vertex.set('dag', dag);
+ });
+ loaders.push(dagFetcher);
+
Em.RSVP.allSettled(loaders).then(function(){
that.set('loading', false);
});
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/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 1bb3197..fe4cc27 100644
--- a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
+++ b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
@@ -240,6 +240,11 @@ App.Helpers.misc = {
});
},
+ getTaskIndex: function(dagID, taskID) {
+ var idPrefix = 'task_%@_'.fmt(dagID.substr(4));
+ return taskID.indexOf(idPrefix) == 0 ? taskID.substr(idPrefix.length) : id;
+ },
+
/**
* Remove the specific record from store
* @param store {DS.Store}
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/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 9b844f7..31ea0de 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/dag.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/dag.js
@@ -313,12 +313,19 @@ App.TezApp = App.AbstractEntity.extend({
App.Task = App.AbstractEntity.extend({
status: DS.attr('status'),
+ index: function () {
+ var id = this.get('id'),
+ idPrefix = 'task_%@_'.fmt(this.get('dagID').substr(4));
+ return id.indexOf(idPrefix) == 0 ? id.substr(idPrefix.length) : id;
+ }.property('id'),
+
dagID: DS.attr('string'),
successfulAttemptId: DS.attr('string'),
attempts: DS.attr('array'),
-
+
+ vertex: DS.belongsTo('vertex'),
vertexID: DS.attr('string'),
startTime: DS.attr('number'),
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js b/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js
index ccaa214..d3d01ad 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js
@@ -16,6 +16,11 @@
*/
App.TaskAttempt = App.AbstractEntity.extend({
+ index: function () {
+ var id = this.get('id'),
+ idPrefix = 'attempt_%@_'.fmt(this.get('dagID').substr(4));
+ return id.indexOf(idPrefix) == 0 ? id.substr(idPrefix.length) : id;
+ }.property('id'),
// start time of the entity
startTime: DS.attr('number'),
@@ -25,7 +30,6 @@ App.TaskAttempt = App.AbstractEntity.extend({
entityType: App.EntityType.TASK_ATTEMPT,
-
// container
containerId: DS.attr('string'),
nodeId: DS.attr('string'),
@@ -33,6 +37,7 @@ App.TaskAttempt = App.AbstractEntity.extend({
// status of the task attempt
status: DS.attr('string'),
+ task: DS.belongsTo('task'),
taskID: DS.attr('string'),
vertexID: DS.attr('string'),
dagID: DS.attr('string'),
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/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 8c81ef7..50d47fd 100644
--- a/tez-ui/src/main/webapp/app/scripts/router.js
+++ b/tez-ui/src/main/webapp/app/scripts/router.js
@@ -168,6 +168,9 @@ App.TaskRoute = Em.Route.extend({
model: function(params) {
return this.store.find('task', params.task_id);
},
+ afterModel: function(model) {
+ return this.controllerFor('task').loadAdditional(model);
+ },
setupController: setupControllerFactory('Task: %@', 'id')
});
@@ -227,7 +230,17 @@ App.VertexSwimlaneRoute = Em.Route.extend({
setupController: setupControllerFactory()
});
-/* --- Task related routes--- */
+/* --- Task Attempt related routes--- */
+
+App.TaskAttemptRoute = Em.Route.extend({
+ model: function(params) {
+ return this.store.find('task_attempt', params.task_attempt_id);
+ },
+ afterModel: function(model) {
+ return this.controllerFor('task_attempt').loadAdditional(model);
+ },
+ setupController: setupControllerFactory('Task Attempt: %@', 'id')
+});
App.TaskAttemptsRoute = Em.Route.extend({
renderTemplate: renderTableWithSpinner,
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/dag.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/dag.hbs b/tez-ui/src/main/webapp/app/templates/dag.hbs
index 950e13c..93af52e 100644
--- a/tez-ui/src/main/webapp/app/templates/dag.hbs
+++ b/tez-ui/src/main/webapp/app/templates/dag.hbs
@@ -18,7 +18,7 @@
<ul class="breadcrumb">
<li>{{#link-to 'application'}}<i class="fa fa-home"> All DAGs</i>{{/link-to}} <span class="divider"></span></li>
- <li class="active">DAG [ {{id}} ]</li>
+ <li class="active">DAG [ {{name}} ]</li>
</ul>
{{#unless loading}}
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/dag/index.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/dag/index.hbs b/tez-ui/src/main/webapp/app/templates/dag/index.hbs
index a4b735a..c17d87f 100644
--- a/tez-ui/src/main/webapp/app/templates/dag/index.hbs
+++ b/tez-ui/src/main/webapp/app/templates/dag/index.hbs
@@ -43,6 +43,10 @@
</td>
</tr>
<tr>
+ <td>{{t 'common.id'}}</td>
+ <td>{{id}}</td>
+ </tr>
+ <tr>
<td>{{t 'common.user'}}</td>
<td>{{user}}</td>
</tr>
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/task.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/task.hbs b/tez-ui/src/main/webapp/app/templates/task.hbs
index c84f840..965e731 100644
--- a/tez-ui/src/main/webapp/app/templates/task.hbs
+++ b/tez-ui/src/main/webapp/app/templates/task.hbs
@@ -18,9 +18,9 @@
<ul class="breadcrumb">
<li>{{#link-to 'application'}}<i class="fa fa-home"> All DAGs</i>{{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'dag.vertices' dagID}}DAG [ {{dagID}} ]{{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'vertex.tasks' vertexID}}Vertex [ {{vertexID}} ] {{/link-to}} <span class="divider"></span></li>
- <li class="active">Task [ {{id}} ]</li>
+ <li>{{#link-to 'dag.vertices' dagID}}DAG [ {{dagName}} ]{{/link-to}} <span class="divider"></span></li>
+ <li>{{#link-to 'vertex.tasks' vertexID}}Vertex [ {{vertexName}} ] {{/link-to}} <span class="divider"></span></li>
+ <li class="active">Task [ {{index}} ]</li>
</ul>
{{#unless loading}}
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/task_attempt.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/task_attempt.hbs b/tez-ui/src/main/webapp/app/templates/task_attempt.hbs
index 278055b..758e66f 100644
--- a/tez-ui/src/main/webapp/app/templates/task_attempt.hbs
+++ b/tez-ui/src/main/webapp/app/templates/task_attempt.hbs
@@ -18,10 +18,10 @@
<ul class="breadcrumb">
<li>{{#link-to 'application'}}<i class="fa fa-home"> All DAGs</i>{{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'dag.vertices' dagID}}DAG [ {{dagID}} ] {{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'vertex.tasks' vertexID}}Vertex [ {{vertexID}} ] {{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'task.attempts' taskID}}Task [ {{taskID}} ] {{/link-to}} <span class="divider"></span></li>
- <li class="active">Task Attempt [ {{id}} ]</li>
+ <li>{{#link-to 'dag.vertices' dagID}}DAG [ {{dagName}} ] {{/link-to}} <span class="divider"></span></li>
+ <li>{{#link-to 'vertex.tasks' vertexID}}Vertex [ {{vertexName}} ] {{/link-to}} <span class="divider"></span></li>
+ <li>{{#link-to 'task.attempts' taskID}}Task [ {{taskIndex}} ] {{/link-to}} <span class="divider"></span></li>
+ <li class="active">Task Attempt [ {{index}} ]</li>
</ul>
{{#unless loading}}
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/tasks.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/tasks.hbs b/tez-ui/src/main/webapp/app/templates/tasks.hbs
index d03c769..70d299f 100644
--- a/tez-ui/src/main/webapp/app/templates/tasks.hbs
+++ b/tez-ui/src/main/webapp/app/templates/tasks.hbs
@@ -18,7 +18,7 @@
<ul class="breadcrumb">
<li>{{#link-to 'application'}}<i class="fa fa-home"> All DAGs</i>{{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'dag.index' parentID}}DAG [ {{parentID}} ]{{/link-to}} <span class="divider"></span></li>
+ <li>{{#link-to 'dag.index' parentID}}DAG [ {{parentName}} ]{{/link-to}} <span class="divider"></span></li>
<li class="active">Tasks</li>
</ul>
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/tez-app.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/tez-app.hbs b/tez-ui/src/main/webapp/app/templates/tez-app.hbs
index 6b925cf..d21c76b 100644
--- a/tez-ui/src/main/webapp/app/templates/tez-app.hbs
+++ b/tez-ui/src/main/webapp/app/templates/tez-app.hbs
@@ -18,7 +18,7 @@
<ul class="breadcrumb">
<li>{{#link-to 'application'}}<i class="fa fa-home"> All DAGs</i>{{/link-to}} <span class="divider"></span></li>
- <li class="active">Tez App [ {{id}} ]</li>
+ <li class="active">Tez App [ {{appDetail.name}} ]</li>
</ul>
{{#unless loading}}
http://git-wip-us.apache.org/repos/asf/tez/blob/0a81409f/tez-ui/src/main/webapp/app/templates/vertex.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/vertex.hbs b/tez-ui/src/main/webapp/app/templates/vertex.hbs
index 0cc985b..da68219 100644
--- a/tez-ui/src/main/webapp/app/templates/vertex.hbs
+++ b/tez-ui/src/main/webapp/app/templates/vertex.hbs
@@ -18,8 +18,8 @@
<ul class="breadcrumb">
<li>{{#link-to 'application'}}<i class="fa fa-home"> All DAGs</i>{{/link-to}} <span class="divider"></span></li>
- <li>{{#link-to 'dag.vertices' dagID}} DAG [ {{dagID}} ] {{/link-to}} <span class="divider"></span></li>
- <li class="active">Vertex [ {{id}} ]</li>
+ <li>{{#link-to 'dag.vertices' dagID}}DAG [ {{dag.name}} ] {{/link-to}} <span class="divider"></span></li>
+ <li class="active">Vertex [ {{name}} ]</li>
</ul>
{{#unless loading}}