tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject tez git commit: TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link (sree)
Date Fri, 22 Jul 2016 19:42:27 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.8 428288fb8 -> 8fe465037


TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link (sree)


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

Branch: refs/heads/branch-0.8
Commit: 8fe46503721bf6c0ed15245786e7d49b0adb5d43
Parents: 428288f
Author: Sreenath Somarajapuram <sree@apache.org>
Authored: Sat Jul 23 01:13:03 2016 +0530
Committer: Sreenath Somarajapuram <sree@apache.org>
Committed: Sat Jul 23 01:13:03 2016 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../main/webapp/app/controllers/dag/attempts.js | 18 +++++++------
 .../webapp/app/controllers/task/attempts.js     | 18 +++++++------
 .../webapp/app/controllers/vertex/attempts.js   | 18 +++++++------
 .../tests/unit/controllers/dag/attempts-test.js | 27 ++++++++++++++++++++
 .../unit/controllers/task/attempts-test.js      | 27 ++++++++++++++++++++
 .../unit/controllers/vertex/attempts-test.js    | 27 ++++++++++++++++++++
 7 files changed, 112 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 276573f..4038eea 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -15,6 +15,7 @@ ALL CHANGES:
   TEZ-3235. Modify Example TestOrderedWordCount job to test the IPC limit for large dag plans.
   TEZ-3337. Do not log empty fields of TaskAttemptFinishedEvent to avoid confusion.
   TEZ-1248. Reduce slow-start should special case 1 reducer runs.
+  TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link
 
 Release 0.8.4: 2016-07-08
 

http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js b/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js
index 9f9ba15..1c661d1 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js
@@ -107,14 +107,16 @@ export default MultiTableController.extend({
       target: "_blank"
     },
     getCellContent: function (row) {
-      return [{
-        href: row.get("logURL"),
-        text: "View"
-      }, {
-        href: row.get("logURL"),
-        text: "Download",
-        download: true
-      }];
+      if(row.get("logURL")) {
+        return [{
+          href: row.get("logURL"),
+          text: "View"
+        }, {
+          href: row.get("logURL"),
+          text: "Download",
+          download: true
+        }];
+      }
     }
   }])
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/tez-ui2/src/main/webapp/app/controllers/task/attempts.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/task/attempts.js b/tez-ui2/src/main/webapp/app/controllers/task/attempts.js
index 6f8257f..140e4b2 100644
--- a/tez-ui2/src/main/webapp/app/controllers/task/attempts.js
+++ b/tez-ui2/src/main/webapp/app/controllers/task/attempts.js
@@ -85,14 +85,16 @@ export default MultiTableController.extend(AutoCounterColumn, {
       target: "_blank"
     },
     getCellContent: function (row) {
-      return [{
-        href: row.get("logURL"),
-        text: "View"
-      }, {
-        href: row.get("logURL"),
-        text: "Download",
-        download: true
-      }];
+      if(row.get("logURL")) {
+        return [{
+          href: row.get("logURL"),
+          text: "View"
+        }, {
+          href: row.get("logURL"),
+          text: "Download",
+          download: true
+        }];
+      }
     }
   }])
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/tez-ui2/src/main/webapp/app/controllers/vertex/attempts.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/vertex/attempts.js b/tez-ui2/src/main/webapp/app/controllers/vertex/attempts.js
index bdda7f8..7e4d12b 100644
--- a/tez-ui2/src/main/webapp/app/controllers/vertex/attempts.js
+++ b/tez-ui2/src/main/webapp/app/controllers/vertex/attempts.js
@@ -97,14 +97,16 @@ export default MultiTableController.extend(AutoCounterColumn, {
       target: "_blank"
     },
     getCellContent: function (row) {
-      return [{
-        href: row.get("logURL"),
-        text: "View"
-      }, {
-        href: row.get("logURL"),
-        text: "Download",
-        download: true
-      }];
+      if(row.get("logURL")) {
+        return [{
+          href: row.get("logURL"),
+          text: "View"
+        }, {
+          href: row.get("logURL"),
+          text: "Download",
+          download: true
+        }];
+      }
     }
   }])
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js
index f1d3d01..3a90018 100644
--- a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js
@@ -38,4 +38,31 @@ test('Basic creation test', function(assert) {
   assert.ok(controller);
   assert.ok(controller.breadcrumbs);
   assert.ok(controller.columns);
+
+  assert.equal(controller.get("columns.length"), 11);
+});
+
+test('Log column test', function(assert) {
+  let controller = this.subject({
+    send: Ember.K,
+    beforeSort: {bind: Ember.K},
+    initVisibleColumns: Ember.K,
+    getCounterColumns: function () {
+      return [];
+    }
+  }),
+  url = "http://abc.com",
+  logColumnDef = controller.get("columns").findBy('id', 'log'),
+  content;
+
+  assert.notOk(logColumnDef.getCellContent(Ember.Object.create()));
+
+  content = logColumnDef.getCellContent(Ember.Object.create({
+    logURL: url
+  }));
+  assert.equal(content[0].href, url);
+  assert.equal(content[0].text, "View");
+  assert.equal(content[1].href, url);
+  assert.equal(content[1].text, "Download");
+  assert.equal(content[1].download, true);
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/tez-ui2/src/main/webapp/tests/unit/controllers/task/attempts-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/task/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/task/attempts-test.js
index 4db8dac..749a67b 100644
--- a/tez-ui2/src/main/webapp/tests/unit/controllers/task/attempts-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/controllers/task/attempts-test.js
@@ -38,4 +38,31 @@ test('Basic creation test', function(assert) {
   assert.ok(controller);
   assert.ok(controller.breadcrumbs);
   assert.ok(controller.columns);
+
+  assert.equal(controller.get("columns.length"), 9);
+});
+
+test('Log column test', function(assert) {
+  let controller = this.subject({
+    send: Ember.K,
+    beforeSort: {bind: Ember.K},
+    initVisibleColumns: Ember.K,
+    getCounterColumns: function () {
+      return [];
+    }
+  }),
+  url = "http://abc.com",
+  logColumnDef = controller.get("columns").findBy('id', 'log'),
+  content;
+
+  assert.notOk(logColumnDef.getCellContent(Ember.Object.create()));
+
+  content = logColumnDef.getCellContent(Ember.Object.create({
+    logURL: url
+  }));
+  assert.equal(content[0].href, url);
+  assert.equal(content[0].text, "View");
+  assert.equal(content[1].href, url);
+  assert.equal(content[1].text, "Download");
+  assert.equal(content[1].download, true);
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8fe46503/tez-ui2/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js
index 142fa58..e2eae25 100644
--- a/tez-ui2/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js
@@ -38,4 +38,31 @@ test('Basic creation test', function(assert) {
   assert.ok(controller);
   assert.ok(controller.breadcrumbs);
   assert.ok(controller.columns);
+
+  assert.equal(controller.get("columns.length"), 10);
+});
+
+test('Log column test', function(assert) {
+  let controller = this.subject({
+    send: Ember.K,
+    beforeSort: {bind: Ember.K},
+    initVisibleColumns: Ember.K,
+    getCounterColumns: function () {
+      return [];
+    }
+  }),
+  url = "http://abc.com",
+  logColumnDef = controller.get("columns").findBy('id', 'log'),
+  content;
+
+  assert.notOk(logColumnDef.getCellContent(Ember.Object.create()));
+
+  content = logColumnDef.getCellContent(Ember.Object.create({
+    logURL: url
+  }));
+  assert.equal(content[0].href, url);
+  assert.equal(content[0].text, "View");
+  assert.equal(content[1].href, url);
+  assert.equal(content[1].text, "Download");
+  assert.equal(content[1].download, true);
 });


Mime
View raw message