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 2014/11/11 07:06:59 UTC
[2/3] tez git commit: TEZ-1751. Log view & download links in task and
task attempt view. (Sreenath Somarajapuram via hitesh)
TEZ-1751. Log view & download links in task and task attempt view. (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/40dc947a
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/40dc947a
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/40dc947a
Branch: refs/heads/TEZ-8
Commit: 40dc947a27f60362103e63f453294229e556e7a0
Parents: 28ef6ec
Author: Hitesh Shah <hi...@apache.org>
Authored: Mon Nov 10 22:04:38 2014 -0800
Committer: Hitesh Shah <hi...@apache.org>
Committed: Mon Nov 10 22:04:38 2014 -0800
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../webapp/app/scripts/controllers/dag_tasks.js | 52 +++++++++++++++++++-
.../task_task_attempts_controller.js | 25 +++++++++-
.../controllers/vertex_tasks_controller.js | 52 +++++++++++++++++++-
.../app/scripts/models/TimelineRestAdapter.js | 6 +++
.../src/main/webapp/app/scripts/models/dag.js | 6 +++
.../webapp/app/scripts/models/task_attempt.js | 3 ++
7 files changed, 141 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9cc4e82..e5a23ce 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -14,6 +14,7 @@ ALL CHANGES:
TEZ-1708. Make UI part of TEZ build process.
TEZ-1617. Shim layer for Tez UI for use within Ambari.
TEZ-1741. App view.
+ TEZ-1751. Log view & download links in task and task attempt view.
Release 0.5.2: Unreleased
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/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 43e6809..a7d3c38 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
@@ -42,6 +42,33 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin, {
this.setFiltersAndLoadEntities(filters);
},
+ loadEntities: function() {
+ var that = this,
+ store = this.get('store'),
+ fetcher;
+ childEntityType = this.get('childEntityType');
+
+ store.unloadAll(childEntityType);
+ store.findQuery(childEntityType, this.getFilterProperties()).then(function(entities){
+ that.set('entities', entities);
+ var pivotLoaders = [];
+ entities.forEach(function (task) {
+ // Pivot attempt selection logic
+ fetcher = store.find('taskAttempt', task.get('successfulAttemptId') || task.get('attempts').lastObject );
+ fetcher.then(function (attempt) {
+ task.set('pivotAttempt', attempt);
+ });
+ pivotLoaders.push(fetcher);
+ });
+ Em.RSVP.allSettled(pivotLoaders).then(function(){
+ that.set('loading', false);
+ });
+ }).catch(function(jqXHR){
+ if(console) console.log(jqXHR);
+ alert('failed');
+ });
+ },
+
actions : {
filterUpdated: function(filterID, value) {
// any validations required goes here.
@@ -118,6 +145,29 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin, {
contentPath: 'id'
});
- return [idCol, vertexCol, startTimeCol, runTimeCol, statusCol, actionsCol];
+ var logs = App.ExTable.ColumnDefinition.create({
+ textAlign: 'text-align-left',
+ headerCellName: 'Logs',
+ tableCellViewClass: Em.Table.TableCell.extend({
+ template: Em.Handlebars.compile(
+ '<span class="ember-table-content">\
+ {{#unless view.cellContent}}\
+ Not Available\
+ {{else}}\
+ <a href="//{{unbound view.cellContent}}">View</a>\
+ \
+ <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+ {{/unless}}\
+ </span>')
+ }),
+ getCellContent: function(row) {
+ var attempt = row.get('pivotAttempt');
+ var logFile = attempt && (attempt.get('inProgressLog') || attempt.get('completedLog'));
+ if(logFile) logFile += "/syslog_" + attempt.get('id');
+ return logFile;
+ }
+ });
+
+ return [idCol, vertexCol, startTimeCol, runTimeCol, statusCol, actionsCol, logs];
}.property(),
});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/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 f795319..1b48277 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
@@ -102,7 +102,28 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
contentPath: 'containerId'
});
- return [idCol, startTimeCol, endTimeCol, statusCol, nodeIdCol, containerCol];
+ var logs = App.ExTable.ColumnDefinition.create({
+ textAlign: 'text-align-left',
+ headerCellName: 'Logs',
+ tableCellViewClass: Em.Table.TableCell.extend({
+ template: Em.Handlebars.compile(
+ '<span class="ember-table-content">\
+ {{#unless view.cellContent}}\
+ Not Available\
+ {{else}}\
+ <a href="//{{unbound view.cellContent}}">View</a>\
+ \
+ <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+ {{/unless}}\
+ </span>')
+ }),
+ getCellContent: function(row) {
+ var logFile = row.get('inProgressLog') || row.get('completedLog');
+ if(logFile) logFile += "/syslog_" + row.get('id');
+ return logFile;
+ }
+ });
+ return [idCol, startTimeCol, endTimeCol, statusCol, nodeIdCol, containerCol, logs];
}.property(),
});
@@ -114,4 +135,4 @@ App.TaskAttemptIndexController = Em.ObjectController.extend({
return App.Helpers.misc.getStatusClassForEntity(this.get('model'));
}.property('id', 'status', 'counterGroups'),
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/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 51f3f5e..a093d86 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
@@ -39,6 +39,33 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
this.setFiltersAndLoadEntities(filters);
},
+ loadEntities: function() {
+ var that = this,
+ store = this.get('store'),
+ fetcher;
+ childEntityType = this.get('childEntityType');
+
+ store.unloadAll(childEntityType);
+ store.findQuery(childEntityType, this.getFilterProperties()).then(function(entities){
+ that.set('entities', entities);
+ var pivotLoaders = [];
+ entities.forEach(function (task) {
+ // Pivot attempt selection logic
+ fetcher = store.find('taskAttempt', task.get('successfulAttemptId') || task.get('attempts').lastObject );
+ fetcher.then(function (attempt) {
+ task.set('pivotAttempt', attempt);
+ });
+ pivotLoaders.push(fetcher);
+ });
+ Em.RSVP.allSettled(pivotLoaders).then(function(){
+ that.set('loading', false);
+ });
+ }).catch(function(jqXHR){
+ if(console) console.log(jqXHR);
+ alert('failed');
+ });
+ },
+
actions : {
filterUpdated: function(filterID, value) {
// any validations required goes here.
@@ -110,6 +137,29 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
contentPath: 'node'
});
- return [idCol, vertexCol, startTimeCol, endTimeCol, statusCol];
+ var logs = App.ExTable.ColumnDefinition.create({
+ textAlign: 'text-align-left',
+ headerCellName: 'Logs',
+ tableCellViewClass: Em.Table.TableCell.extend({
+ template: Em.Handlebars.compile(
+ '<span class="ember-table-content">\
+ {{#unless view.cellContent}}\
+ Not Available\
+ {{else}}\
+ <a href="//{{unbound view.cellContent}}">View</a>\
+ \
+ <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+ {{/unless}}\
+ </span>')
+ }),
+ getCellContent: function(row) {
+ var attempt = row.get('pivotAttempt');
+ var logFile = attempt && (attempt.get('inProgressLog') || attempt.get('completedLog'));
+ if(logFile) logFile += "/syslog_" + attempt.get('id');
+ return logFile;
+ }
+ });
+
+ return [idCol, vertexCol, startTimeCol, endTimeCol, statusCol, logs];
}.property(),
});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/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 468b906..c9e470a 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
@@ -157,6 +157,10 @@ var timelineJsonToTaskAttemptMap = {
status: 'otherinfo.status',
diagnostics: 'otherinfo.diagnostics',
counterGroups: 'counterGroups',
+
+ inProgressLog: 'otherinfo.inProgressLogsURL',
+ completedLog: 'otherinfo.completedLogsURL',
+
vertexID: 'primaryfilters.TEZ_VERTEX_ID.0',
dagID: 'primaryfilters.TEZ_DAG_ID.0',
containerId: { custom: function (source) {
@@ -223,6 +227,8 @@ var timelineJsonToTaskMap = {
status: 'otherinfo.status',
diagnostics: 'otherinfo.diagnostics',
counterGroups: 'counterGroups',
+ successfulAttemptId: 'otherinfo.successfulAttemptId',
+ attempts: 'relatedentities.TEZ_TASK_ATTEMPT_ID',
vertexID: 'primaryfilters.TEZ_VERTEX_ID.0',
dagID: 'primaryfilters.TEZ_DAG_ID.0',
numAttempts: 'relatedentities'
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/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 2dbb0d7..05390c0 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/dag.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/dag.js
@@ -255,6 +255,10 @@ App.Task = App.AbstractEntity.extend({
status: DS.attr('status'),
dagID: DS.attr('string'),
+
+ successfulAttemptId: DS.attr('string'),
+
+ attempts: DS.attr('array'),
vertexID: DS.attr('string'),
@@ -266,6 +270,8 @@ App.Task = App.AbstractEntity.extend({
numAttempts: DS.attr('number'),
+ pivotAttempt: DS.belongsTo('taskAttempt'),
+
counterGroups: DS.hasMany('counterGroup', { inverse: 'parent' })
});
http://git-wip-us.apache.org/repos/asf/tez/blob/40dc947a/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 db1d3c1..d7acbe1 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
@@ -39,5 +39,8 @@ App.TaskAttempt = App.AbstractEntity.extend({
dagID: DS.attr('string'),
+ inProgressLog: DS.attr('string'),
+ completedLog: DS.attr('string'),
+
counterGroups: DS.hasMany('counterGroup', { inverse: 'parent' })
});