tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject [5/5] tez git commit: TEZ-2078. Tez UI: Task logs url use in-progress url causing various errors. (Sreenath Somarajapuram via hitesh)
Date Wed, 11 Feb 2015 20:20:00 GMT
TEZ-2078. Tez UI: Task logs url use in-progress url causing various errors. (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/758c26f0
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/758c26f0
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/758c26f0

Branch: refs/heads/master
Commit: 758c26f0282ed11f059578240b677774e2a5ee69
Parents: 96a61f8
Author: Hitesh Shah <hitesh@apache.org>
Authored: Wed Feb 11 12:19:05 2015 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Wed Feb 11 12:19:05 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../controllers/dag-task-attempts-controller.js | 32 +++++++--
 .../app/scripts/controllers/dag_controller.js   |  7 ++
 .../webapp/app/scripts/controllers/dag_tasks.js | 39 +++++++---
 .../task_task_attempts_controller.js            | 75 ++++++++++++++++++--
 .../scripts/controllers/vertex_controller.js    | 13 +++-
 .../vertex_task_attempts_controller.js          | 32 +++++++--
 .../controllers/vertex_tasks_controller.js      | 39 +++++++---
 .../app/scripts/models/TimelineRestAdapter.js   |  1 -
 9 files changed, 199 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 79674a8..bfecc37 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -61,6 +61,7 @@ Release 0.6.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2078. Tez UI: Task logs url use in-progress url causing various errors.
   TEZ-2077. Tez UI: No diagnostics on Task Attempt Details page if task attempt failed. 
   TEZ-2065. Setting up tez.tez-ui.history-url.base with a trailing slash can result in failures
to redirect correctly. 
   TEZ-2068. Tez UI: Dag view should use full window height, disable webuiservice in localmode.

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 d473d9a..d151af8 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
@@ -53,6 +53,7 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
   },
 
   defaultColumnConfigs: function() {
+    var that = this;
     return [
       {
         id: 'taskId',
@@ -158,19 +159,36 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">\
-              {{#unless view.cellContent}}\
+              {{#unless view.cellContent.notAvailable}}\
                 Not Available\
               {{else}}\
-                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
-                &nbsp;\
-                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download
target="_blank" type="application/octet-stream">Download</a>\
+                {{#if view.cellContent.viewUrl}}\
+                  <a target="_blank" href="//{{unbound view.cellContent.viewUrl}}">View</a>\
+                  &nbsp;\
+                {{/if}}\
+                {{#if view.cellContent.downloadUrl}}\
+                  <a target="_blank" href="{{unbound view.cellContent.downloadUrl}}?start=0"
download type="application/octet-stream">Download</a>\
+                {{/if}}\
               {{/unless}}\
             </span>')
         }),
         getCellContent: function(row) {
-          var logFile = row.get('inProgressLog') || row.get('completedLog');
-          if(logFile) logFile += "/syslog_" + row.get('id');
-          return logFile;
+          var yarnAppState = that.get('controllers.dag.yarnAppState'),
+              suffix = "/syslog_" + row.get('id'),
+              link = row.get('inProgressLog') || row.get('completedLog'),
+              cellContent = {};
+
+          if(link) {
+            cellContent.viewUrl = link + suffix;
+          }
+          link = row.get('completedLog');
+          if (link && yarnAppState === 'FINISHED' || yarnAppState === 'KILLED' ||
yarnAppState === 'FAILED') {
+            cellContent.downloadUrl = link + suffix;
+          }
+
+          cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+
+          return cellContent;
         }
       }
     ];

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 b17157f..b488841 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
@@ -46,6 +46,13 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
         that.set('tezApp', app);
       });
 
+    var appDetailFetcher = that.store.find('appDetail', applicationId).then(function(appDetail)
{
+      var appState = appDetail.get('appState');
+      if (appState) {
+        that.set('yarnAppState', appState);
+      }
+    });
+    loaders.push(appDetailFetcher);
     Em.RSVP.allSettled(loaders).then(function(){
       that.set('loading', false);
     });

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 3be59f0..849b1db 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
@@ -96,6 +96,7 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
   },
 
   defaultColumnConfigs: function() {
+    var that = this;
     return [
       {
         id: 'id',
@@ -183,20 +184,42 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin,
A
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">\
-              {{#unless view.cellContent}}\
+              {{#unless view.cellContent.notAvailable}}\
                 Not Available\
               {{else}}\
-                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
-                &nbsp;\
-                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download
target="_blank" type="application/octet-stream">Download</a>\
+                {{#if view.cellContent.viewUrl}}\
+                  <a target="_blank" href="//{{unbound view.cellContent.viewUrl}}">View</a>\
+                  &nbsp;\
+                {{/if}}\
+                {{#if view.cellContent.downloadUrl}}\
+                  <a target="_blank" href="{{unbound view.cellContent.downloadUrl}}?start=0"
download type="application/octet-stream">Download</a>\
+                {{/if}}\
               {{/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;
+          var yarnAppState = that.get('controllers.dag.yarnAppState'),
+              attempt = row.get('pivotAttempt'),
+              suffix,
+              link,
+              cellContent = {};
+
+          if(attempt) {
+            suffix = "/syslog_" + attempt.get('id'),
+            link = attempt.get('inProgressLog') || attempt.get('completedLog');
+
+            if(link) {
+              cellContent.viewUrl = link + suffix;
+            }
+            link = attempt.get('completedLog');
+            if (link && yarnAppState === 'FINISHED' || yarnAppState === 'KILLED'
|| yarnAppState === 'FAILED') {
+              cellContent.downloadUrl = link + suffix;
+            }
+          }
+
+          cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+
+          return cellContent;
         }
       }
     ];

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 aacefe3..84de0a7 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
@@ -41,6 +41,49 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
     this.setFiltersAndLoadEntities(filters);
   },
 
+  loadEntities: function () {
+    var that = this;
+    var childEntityType = this.get('childEntityType');
+    var defaultErrMsg = 'Error while loading %@. could not connect to %@'
+      .fmt(childEntityType, App.env.timelineBaseUrl);
+
+    that.set('loading', true);
+
+    this.get('store').unloadAll(childEntityType);
+    this.get('store').findQuery(childEntityType, this.getFilterProperties()).then(function(entities){
+      that.set('entities', entities);
+      var loaders = [];
+      try {
+        var loader = Em.tryInvoke(that, 'loadAdditional');
+        if (!!loader) {
+          loaders.push(loader);
+        }
+      } catch(error) {
+        Em.Logger.error("Exception invoking additional load", error);
+      }
+
+      var appDetailFetcher = that.store.find('dag', that.get('controllers.task.dagID')).
+        then(function (dag) {
+          return that.store.find('appDetail', dag.get('applicationId'));
+        }).
+        then(function(appDetail) {
+          var appState = appDetail.get('appState');
+          if (appState) {
+            that.set('yarnAppState', appState);
+          }
+        });
+      loaders.push(appDetailFetcher);
+      Em.RSVP.allSettled(loaders).then(function(){
+          that.set('loading', false);
+      });
+    }).catch(function(error){
+      Em.Logger.error(error);
+      var err = App.Helpers.misc.formatError(error, defaultErrMsg);
+      var msg = 'error code: %@, message: %@'.fmt(err.errCode, err.msg);
+      App.Helpers.ErrorBar.getInstance().show(msg, err.details);
+    });
+  },
+
   actions : {
     filterUpdated: function(filterID, value) {
       // any validations required goes here.
@@ -54,6 +97,7 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
   },
 
   defaultColumnConfigs: function() {
+    var that = this;
     return [
       {
         id: 'id',
@@ -159,19 +203,36 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">\
-              {{#unless view.cellContent}}\
+              {{#unless view.cellContent.notAvailable}}\
                 Not Available\
               {{else}}\
-                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
-                &nbsp;\
-                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download
target="_blank" type="application/octet-stream">Download</a>\
+                {{#if view.cellContent.viewUrl}}\
+                  <a target="_blank" href="//{{unbound view.cellContent.viewUrl}}">View</a>\
+                  &nbsp;\
+                {{/if}}\
+                {{#if view.cellContent.downloadUrl}}\
+                  <a target="_blank" href="{{unbound view.cellContent.downloadUrl}}?start=0"
download type="application/octet-stream">Download</a>\
+                {{/if}}\
               {{/unless}}\
             </span>')
         }),
         getCellContent: function(row) {
-          var logFile = row.get('inProgressLog') || row.get('completedLog');
-          if(logFile) logFile += "/syslog_" + row.get('id');
-          return logFile;
+          var yarnAppState = that.get('yarnAppState'),
+              suffix = "/syslog_" + row.get('id'),
+              link = row.get('inProgressLog') || row.get('completedLog'),
+              cellContent = {};
+
+          if(link) {
+            cellContent.viewUrl = link + suffix;
+          }
+          link = row.get('completedLog');
+          if (link && yarnAppState === 'FINISHED' || yarnAppState === 'KILLED' ||
yarnAppState === 'FAILED') {
+            cellContent.downloadUrl = link + suffix;
+          }
+
+          cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+
+          return cellContent;
         }
       }
     ];

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 e5e74e5..3c56690 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
@@ -25,12 +25,13 @@ App.VertexController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
 
   updateLoading: function() {
     var loaders = [],
-      that = this;
+      that = this,
+      applicationId = this.get('applicationId');
 
     if (this.get('status') == 'RUNNING') {
       var vertexIdx = that.get('id').split('_').splice(-1).pop();
       var progressLoader = this.store.find('vertexProgress', vertexIdx, {
-        appId: that.get('applicationId'),
+        appId: applicationId,
         dagIdx: that.get('dagIdx')
       }).then(function(vertexProgressInfo) {
         if (vertexProgressInfo) {
@@ -41,6 +42,14 @@ App.VertexController = Em.ObjectController.extend(App.Helpers.DisplayHelper,
{
       });
       loaders.push(progressLoader);
     }
+
+    var appDetailFetcher = that.store.find('appDetail', applicationId).then(function(appDetail)
{
+      var appState = appDetail.get('appState');
+      if (appState) {
+        that.set('yarnAppState', appState);
+      }
+    });
+    loaders.push(appDetailFetcher);
     Em.RSVP.allSettled(loaders).then(function(){
       that.set('loading', false);
     });

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 4c38f51..e6ee417 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,6 +54,7 @@ App.VertexTaskAttemptsController = Em.ObjectController.extend(App.PaginatedConte
   },
 
   defaultColumnConfigs: function() {
+    var that = this;
     return [
       {
         id: 'taskId',
@@ -159,19 +160,36 @@ App.VertexTaskAttemptsController = Em.ObjectController.extend(App.PaginatedConte
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">\
-              {{#unless view.cellContent}}\
+              {{#unless view.cellContent.notAvailable}}\
                 Not Available\
               {{else}}\
-                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
-                &nbsp;\
-                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download
target="_blank" type="application/octet-stream">Download</a>\
+                {{#if view.cellContent.viewUrl}}\
+                  <a target="_blank" href="//{{unbound view.cellContent.viewUrl}}">View</a>\
+                  &nbsp;\
+                {{/if}}\
+                {{#if view.cellContent.downloadUrl}}\
+                  <a target="_blank" href="{{unbound view.cellContent.downloadUrl}}?start=0"
download type="application/octet-stream">Download</a>\
+                {{/if}}\
               {{/unless}}\
             </span>')
         }),
         getCellContent: function(row) {
-          var logFile = row.get('inProgressLog') || row.get('completedLog');
-          if(logFile) logFile += "/syslog_" + row.get('id');
-          return logFile;
+          var yarnAppState = that.get('controllers.vertex.yarnAppState'),
+              suffix = "/syslog_" + row.get('id'),
+              link = row.get('inProgressLog') || row.get('completedLog'),
+              cellContent = {};
+
+          if(link) {
+            cellContent.viewUrl = link + suffix;
+          }
+          link = row.get('completedLog');
+          if (link && yarnAppState === 'FINISHED' || yarnAppState === 'KILLED' ||
yarnAppState === 'FAILED') {
+            cellContent.downloadUrl = link + suffix;
+          }
+
+          cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+
+          return cellContent;
         }
       }
     ];

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 1edb834..90340ff 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
@@ -87,6 +87,7 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
   },
 
   defaultColumnConfigs: function() {
+    var that = this;
     return [
       {
         id: 'id',
@@ -167,20 +168,42 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
         tableCellViewClass: Em.Table.TableCell.extend({
           template: Em.Handlebars.compile(
             '<span class="ember-table-content">\
-              {{#unless view.cellContent}}\
+              {{#unless view.cellContent.notAvailable}}\
                 Not Available\
               {{else}}\
-                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
-                &nbsp;\
-                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download
target="_blank" type="application/octet-stream">Download</a>\
+                {{#if view.cellContent.viewUrl}}\
+                  <a target="_blank" href="//{{unbound view.cellContent.viewUrl}}">View</a>\
+                  &nbsp;\
+                {{/if}}\
+                {{#if view.cellContent.downloadUrl}}\
+                  <a target="_blank" href="{{unbound view.cellContent.downloadUrl}}?start=0"
download type="application/octet-stream">Download</a>\
+                {{/if}}\
               {{/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;
+          var yarnAppState = that.get('controllers.vertex.yarnAppState'),
+              attempt = row.get('pivotAttempt'),
+              suffix,
+              link,
+              cellContent = {};
+
+          if(attempt) {
+            suffix = "/syslog_" + attempt.get('id'),
+            link = attempt.get('inProgressLog') || attempt.get('completedLog');
+
+            if(link) {
+              cellContent.viewUrl = link + suffix;
+            }
+            link = attempt.get('completedLog');
+            if (link && yarnAppState === 'FINISHED' || yarnAppState === 'KILLED'
|| yarnAppState === 'FAILED') {
+              cellContent.downloadUrl = link + suffix;
+            }
+          }
+
+          cellContent.notAvailable = cellContent.viewUrl || cellContent.downloadUrl;
+
+          return cellContent;
         }
       }
     ];

http://git-wip-us.apache.org/repos/asf/tez/blob/758c26f0/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 ed524dd..09c81ad 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
@@ -229,7 +229,6 @@ var timelineJsonToTaskMap = {
   counterGroups: 'counterGroups',
   successfulAttemptId: 'otherinfo.successfulAttemptId',
   attempts: 'relatedentities.TEZ_TASK_ATTEMPT_ID',
-  dagID: 'primaryfilters.TEZ_DAG_ID.0',
   numAttempts: 'relatedentities.TEZ_TASK_ATTEMPT_ID.length'
 };
 


Mime
View raw message