tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject tez git commit: TEZ-2129. Task and Attempt views should contain links to the logs (jeagles)
Date Fri, 08 Jan 2016 20:42:49 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.7 150d494da -> f4de7744d


TEZ-2129. Task and Attempt views should contain links to the logs (jeagles)


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

Branch: refs/heads/branch-0.7
Commit: f4de7744d2991e4cad8f870fc67fb9a970540a7c
Parents: 150d494
Author: Jonathan Eagles <jeagles@yahoo-inc.com>
Authored: Fri Jan 8 14:37:03 2016 -0600
Committer: Jonathan Eagles <jeagles@yahoo-inc.com>
Committed: Fri Jan 8 14:41:59 2016 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../controllers/task_attempt_controller.js      |  6 ++++-
 .../app/scripts/controllers/task_controller.js  |  5 +++-
 .../controllers/task_index_controller.js        | 27 +++++++++++++++++++-
 .../task_task_attempts_controller.js            | 13 ++++++++++
 .../main/webapp/app/templates/task/index.hbs    | 17 ++++++++++++
 .../webapp/app/templates/taskAttempt/index.hbs  | 17 ++++++++++++
 7 files changed, 83 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 489580f..316d6cd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
   TEZ-2972. Avoid task rescheduling when a node turns unhealthy
 
 ALL CHANGES
+  TEZ-2129. Task and Attempt views should contain links to the logs
   TEZ-3025. InputInitializer creation should use the dag ugi.
   TEZ-2972. Avoid task rescheduling when a node turns unhealthy
   TEZ-3017. HistoryACLManager does not have a close method for cleanup

http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/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 3485c33..de24ccd 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
@@ -69,20 +69,24 @@ App.TaskAttemptController = App.BaseController.extend(App.Helpers.DisplayHelper,
 
   loadAdditional: function(attempt) {
     var that = this;
+    var applicationId = App.Helpers.misc.getAppIdFromVertexId(attempt.get('vertexID'));
 
     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 appDetailLoader = App.Helpers.misc.loadApp(this.store, applicationId);
 
     var allLoaders = Em.RSVP.hash({
       dag: dagLoader,
       vertex: vertexLoader,
-      task: taskLoader
+      task: taskLoader,
+      appDetail: appDetailLoader
     });
     allLoaders.then(function(results) {
       attempt.set('task', results.task);
       attempt.set('task.vertex', results.vertex);
       attempt.set('task.vertex.dag', results.dag);
+      attempt.set('appDetail', results.appDetail);
     }).finally(function() {
       that.set('loading', false);
     });

http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/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 b7a6036..829881f 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
@@ -64,18 +64,21 @@ App.TaskController = App.PollingController.extend(App.Helpers.DisplayHelper,
App
     var dagLoader = this.store.find('dag', task.get('dagID'));
     var vertexLoader = this.store.find('vertex', task.get('vertexID'));
     var tezAppLoader = this.store.find('tezApp', 'tez_' + applicationId);
+    var appDetailLoader = App.Helpers.misc.loadApp(this.store, applicationId);
 
     task.set('progress', undefined);
     var allLoaders = Em.RSVP.hash({
       dag: dagLoader,
       vertex: vertexLoader,
-      tezApp: tezAppLoader
+      tezApp: tezAppLoader,
+      appDetail: appDetailLoader
     });
 
     allLoaders.then(function(results) {
       task.set('vertex', results.vertex);
       task.set('vertex.dag', results.dag);
       task.set('tezApp', results.tezApp);
+      task.set('appDetail', results.appDetail);
     }).finally(function() {
       that.set('loading', false);
     });

http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/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 eca4ee1..96258f1 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
@@ -20,6 +20,8 @@
 App.TaskIndexController = App.PollingController.extend(App.ModelRefreshMixin, {
   controllerName: 'TaskIndexController',
 
+  needs: "task",
+
   taskStatus: function() {
     return App.Helpers.misc.getFixedupDisplayStatus(this.get('model.status'));
   }.property('id', 'model.status'),
@@ -40,4 +42,27 @@ App.TaskIndexController = App.PollingController.extend(App.ModelRefreshMixin,
{
     }
   },
 
-});
\ No newline at end of file
+  logsLink: null,
+
+  logsLinkObserver: function() {
+
+    var model = this.get('content');
+    var taskAttemptId = model.get('successfulAttemptId') || model.get('attempts.lastObject');
+    var store = this.get('store');
+    var that = this;
+
+    if (taskAttemptId) {
+      store.find('taskAttempt', taskAttemptId).then(function(attempt) {
+          var cellContent = App.Helpers.misc.constructLogLinks(
+              attempt,
+              that.get('controllers.task.appDetail.status'),
+              that.get('controllers.task.tezApp.user')
+              );
+
+          cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+          that.set('logsLink', cellContent);
+        });
+    }
+  }.observes('id', 'successfulAttemptId'),
+
+});

http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/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 0f11379..580af05 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
@@ -223,6 +223,8 @@ App.TaskAttemptsController = App.TablePageController.extend(App.AutoCounterColum
 App.TaskAttemptIndexController = Em.ObjectController.extend(App.ModelRefreshMixin, {
   controllerName: 'TaskAttemptIndexController',
 
+  needs: "taskAttempt",
+
   taskAttemptStatus: function() {
     return App.Helpers.misc.getFixedupDisplayStatus(this.get('status'));
   }.property('id', 'status'),
@@ -242,4 +244,15 @@ App.TaskAttemptIndexController = Em.ObjectController.extend(App.ModelRefreshMixi
     }
   },
 
+  logsLink: function() {
+    var cellContent = App.Helpers.misc.constructLogLinks(
+      this.get('content'),
+      this.get('controllers.taskAttempt.appDetail.status'),
+      this.get('controllers.taskAttempt.tezApp.user')
+    );
+
+    cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+    return cellContent;
+  }.property('id', 'controllers.taskAttempt'),
+
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/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 05adec4..09cd986 100644
--- a/tez-ui/src/main/webapp/app/templates/task/index.hbs
+++ b/tez-ui/src/main/webapp/app/templates/task/index.hbs
@@ -64,6 +64,23 @@
 					<td>{{t 'common.time.duration'}}</td>
 					<td>{{formatDuration startTime endTime}}</td>
 				</tr>
+        <tr>
+          <td>Logs</td>
+          <td>
+            {{#if logsLink.viewUrl}}
+              <a target="_blank" href='//{{unbound logsLink.viewUrl}}'>View</a>
+              &nbsp;
+            {{/if}}
+            {{#if logsLink.downloadUrl}}
+              <a target="_blank" href='{{unbound logsLink.downloadUrl}}' download type="application/octet-stream">Download</a>
+            {{/if}}
+            {{#unless logsLink.viewUrl}}
+              {{#unless logsLink.downloadUrl}}
+                <span class="message">Not Available!</span>
+              {{/unless}}
+            {{/unless}}
+          </td>
+        </tr>
 			</tbody>
 		</table>
 	</div>

http://git-wip-us.apache.org/repos/asf/tez/blob/f4de7744/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 c7e3330..e1c60d1 100644
--- a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs
+++ b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs
@@ -72,6 +72,23 @@
 					<td>{{t 'common.time.duration'}}</td>
 					<td>{{formatDuration startTime endTime}}</td>
 				</tr>
+        <tr>
+          <td>Logs</td>
+          <td>
+            {{#if logsLink.viewUrl}}
+              <a target="_blank" href='//{{unbound logsLink.viewUrl}}'>View</a>
+              &nbsp;
+            {{/if}}
+            {{#if logsLink.downloadUrl}}
+              <a target="_blank" href='{{unbound logsLink.downloadUrl}}' download type="application/octet-stream">Download</a>
+            {{/if}}
+            {{#unless logsLink.viewUrl}}
+              {{#unless logsLink.downloadUrl}}
+                <span class="message">Not Available!</span>
+              {{/unless}}
+            {{/unless}}
+          </td>
+        </tr>
 			</tbody>
 		</table>
 	</div>


Mime
View raw message