You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by sr...@apache.org on 2016/02/17 11:30:27 UTC

tez git commit: TEZ-2916. Tez UI 2: Show counts of running tasks on the DAG visualization page (sree)

Repository: tez
Updated Branches:
  refs/heads/TEZ-2980 af3ca10ac -> bff263655


TEZ-2916. Tez UI 2: Show counts of running tasks on the DAG visualization page (sree)


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

Branch: refs/heads/TEZ-2980
Commit: bff263655d9b7aefa29799a49aeea5f20f75a4c4
Parents: af3ca10
Author: Sreenath Somarajapuram <sr...@apache.org>
Authored: Wed Feb 17 15:59:56 2016 +0530
Committer: Sreenath Somarajapuram <sr...@apache.org>
Committed: Wed Feb 17 15:59:56 2016 +0530

----------------------------------------------------------------------
 TEZ-2980-CHANGES.txt                            |  1 +
 .../webapp/app/controllers/dag/graphical.js     | 15 +++++++
 .../main/webapp/app/controllers/dag/vertices.js | 36 +++++++++++++++-
 .../src/main/webapp/app/controllers/table.js    |  2 +-
 .../tests/unit/controllers/dag/vertices-test.js | 43 ++++++++++++++++++++
 5 files changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/bff26365/TEZ-2980-CHANGES.txt
----------------------------------------------------------------------
diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt
index 9d949ca..512492b 100644
--- a/TEZ-2980-CHANGES.txt
+++ b/TEZ-2980-CHANGES.txt
@@ -36,3 +36,4 @@ ALL CHANGES:
   TEZ-3092. Tez UI 2: Tuneups & Improvements
   TEZ-3095. Tez UI 2: Tuneups & Improvements
   TEZ-3088. Tez UI 2: Licenses of all the packages used by Tez Ui must be documented
+  TEZ-2916. Tez UI 2: Show counts of running tasks on the DAG visualization page

http://git-wip-us.apache.org/repos/asf/tez/blob/bff26365/tez-ui2/src/main/webapp/app/controllers/dag/graphical.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/graphical.js b/tez-ui2/src/main/webapp/app/controllers/dag/graphical.js
index 86d534a..470628c 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dag/graphical.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dag/graphical.js
@@ -85,6 +85,21 @@ export default MultiTableController.extend({
     headerTitle: 'Tasks',
     contentPath: 'totalTasks',
   },{
+    id: 'succeededTasks',
+    headerTitle: 'Succeeded Tasks',
+    contentPath: 'succeededTasks',
+    observePath: true
+  },{
+    id: 'runningTasks',
+    headerTitle: 'Running Tasks',
+    contentPath: 'runningTasks',
+    observePath: true
+  },{
+    id: 'pendingTasks',
+    headerTitle: 'Pending Tasks',
+    contentPath: 'pendingTasks',
+    observePath: true
+  },{
     id: 'processorClassName',
     headerTitle: 'Processor Class',
     contentPath: 'processorClassName',

http://git-wip-us.apache.org/repos/asf/tez/blob/bff26365/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js b/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js
index f42a667..306d606 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js
@@ -80,9 +80,43 @@ export default MultiTableController.extend({
     headerTitle: 'Tasks',
     contentPath: 'totalTasks',
   },{
+    id: 'succeededTasks',
+    headerTitle: 'Succeeded Tasks',
+    contentPath: 'succeededTasks',
+    observePath: true
+  },{
+    id: 'runningTasks',
+    headerTitle: 'Running Tasks',
+    contentPath: 'runningTasks',
+    observePath: true
+  },{
+    id: 'pendingTasks',
+    headerTitle: 'Pending Tasks',
+    contentPath: 'pendingTasks',
+    observePath: true
+  },{
     id: 'processorClassName',
     headerTitle: 'Processor Class',
     contentPath: 'processorClassName',
-  }])
+  }]),
+
+  beforeSort: function (columnDefinition) {
+    if(this._super(columnDefinition)) {
+      if(this.get("polling.isReady")) {
+        let columnName = columnDefinition.get("headerTitle");
+        switch(columnDefinition.get("contentPath")) {
+          case "succeededTasks":
+          case "runningTasks":
+          case "pendingTasks":
+            this.send("openModal", {
+              title: "Cannot sort!",
+              content: `Sorting on ${columnName} is disabled for running DAGs!`
+            });
+            return false;
+        }
+      }
+    }
+    return true;
+  }
 
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/bff26365/tez-ui2/src/main/webapp/app/controllers/table.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/table.js b/tez-ui2/src/main/webapp/app/controllers/table.js
index ca2bae8..f0bce1c 100644
--- a/tez-ui2/src/main/webapp/app/controllers/table.js
+++ b/tez-ui2/src/main/webapp/app/controllers/table.js
@@ -45,7 +45,7 @@ export default AbstractController.extend({
 
   polling: Ember.inject.service("pollster"),
 
-  definition: Ember.computed(function () {
+  definition: Ember.computed("model", function () {
     return TableDefinition.create({
       rowCount: this.get("rowCount"),
       searchText: this.get("searchText"),

http://git-wip-us.apache.org/repos/asf/tez/blob/bff26365/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js
index fa7bec0..0c5f766 100644
--- a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js
@@ -38,4 +38,47 @@ test('Basic creation test', function(assert) {
   assert.ok(controller);
   assert.ok(controller.breadcrumbs);
   assert.ok(controller.columns);
+  assert.ok(controller.beforeSort);
+});
+
+test('beforeSort test', function(assert) {
+  let controller = this.subject({
+    initVisibleColumns: Ember.K,
+    getCounterColumns: function () {
+      return [];
+    },
+    polling: {
+      isReady: true
+    },
+    send: function (actionName) {
+      if(actionName === "openModal") {
+        assert.ok(true);
+      }
+    }
+  });
+
+  // Bind poilyfill
+  Function.prototype.bind = function (context) {
+    var that = this;
+    return function (val) {
+      return that.call(context, val);
+    };
+  };
+
+  assert.expect(1 + 3 + 3);
+
+  assert.ok(controller.beforeSort(Ember.Object.create({
+    contentPath: "NonDisabledColumn"
+  })), "NonDisabledColumn");
+
+  assert.notOk(controller.beforeSort(Ember.Object.create({
+    contentPath: "succeededTasks"
+  })), "succeededTasks");
+  assert.notOk(controller.beforeSort(Ember.Object.create({
+    contentPath: "runningTasks"
+  })), "runningTasks");
+  assert.notOk(controller.beforeSort(Ember.Object.create({
+    contentPath: "pendingTasks"
+  })), "pendingTasks");
+
 });