tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhiyu...@apache.org
Subject [17/50] [abbrv] tez git commit: TEZ-3630. Tez UI: Use DAG status for controlling auto-refresh polling (sree)
Date Tue, 28 Mar 2017 19:47:58 GMT
TEZ-3630. Tez UI: Use DAG status for controlling auto-refresh polling (sree)


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

Branch: refs/heads/TEZ-1190
Commit: 359cd75ca7933443cb5fca01fc3254d2ae8d4adf
Parents: 2d8090e
Author: Sreenath Somarajapuram <sree@apache.org>
Authored: Fri Feb 24 00:27:13 2017 +0530
Committer: Sreenath Somarajapuram <sree@apache.org>
Committed: Fri Feb 24 00:27:13 2017 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../main/webapp/app/routes/multi-am-pollster.js |  7 +++-
 .../webapp/app/routes/single-am-pollster.js     |  7 +++-
 .../tests/unit/routes/multi-am-pollster-test.js | 44 ++++++++++++++++++++
 .../unit/routes/single-am-pollster-test.js      | 23 ++++++++--
 5 files changed, 74 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/359cd75c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a1e23f4..b855af0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -203,6 +203,7 @@ ALL CHANGES:
   TEZ-3619. Tez UI: Improve DAG Data download
   TEZ-3629. Tez UI: Enable the UI to display log links from LLAP
   TEZ-3626. Tez UI: First Task Start Time & Last Task Finish Time values are showing
up incorrectly
+  TEZ-3630. Tez UI: Use DAG status for controlling auto-refresh polling
 
 Release 0.8.5: Unreleased
 

http://git-wip-us.apache.org/repos/asf/tez/blob/359cd75c/tez-ui/src/main/webapp/app/routes/multi-am-pollster.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/routes/multi-am-pollster.js b/tez-ui/src/main/webapp/app/routes/multi-am-pollster.js
index c3260a6..ca20cd5 100644
--- a/tez-ui/src/main/webapp/app/routes/multi-am-pollster.js
+++ b/tez-ui/src/main/webapp/app/routes/multi-am-pollster.js
@@ -21,8 +21,11 @@ import AmPollsterRoute from './am-pollster';
 
 export default AmPollsterRoute.extend({
 
-  canPoll: Ember.computed("polledRecords.0.app.isComplete", "loadedValue", function () {
-    var isComplete = this.get("polledRecords.0.app.isComplete");
+  canPoll: Ember.computed("polledRecords.0.dag.isComplete", "polledRecords.0.app.isComplete",
"loadedValue", function () {
+    var isComplete = this.get("polledRecords.0.dag.isComplete");
+    if(isComplete === undefined) {
+      isComplete = this.get("polledRecords.0.app.isComplete");
+    }
     return isComplete === false && this._super();
   }),
 

http://git-wip-us.apache.org/repos/asf/tez/blob/359cd75c/tez-ui/src/main/webapp/app/routes/single-am-pollster.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/routes/single-am-pollster.js b/tez-ui/src/main/webapp/app/routes/single-am-pollster.js
index 4b72ee7..27bcced 100644
--- a/tez-ui/src/main/webapp/app/routes/single-am-pollster.js
+++ b/tez-ui/src/main/webapp/app/routes/single-am-pollster.js
@@ -21,8 +21,11 @@ import AmPollsterRoute from './am-pollster';
 
 export default AmPollsterRoute.extend({
 
-  canPoll: Ember.computed("polledRecords", "loadedValue.app.isComplete", function () {
-    var isComplete = this.get("loadedValue.app.isComplete");
+  canPoll: Ember.computed("polledRecords", "loadedValue.dag.isComplete", "loadedValue.app.isComplete",
function () {
+    var isComplete = this.get("loadedValue.dag.isComplete");
+    if(isComplete === undefined) {
+      isComplete = this.get("loadedValue.app.isComplete");
+    }
     return isComplete === false && this._super();
   }),
 

http://git-wip-us.apache.org/repos/asf/tez/blob/359cd75c/tez-ui/src/main/webapp/tests/unit/routes/multi-am-pollster-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/routes/multi-am-pollster-test.js b/tez-ui/src/main/webapp/tests/unit/routes/multi-am-pollster-test.js
index eb3670b..2903d39 100644
--- a/tez-ui/src/main/webapp/tests/unit/routes/multi-am-pollster-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/routes/multi-am-pollster-test.js
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import Ember from 'ember';
 import { moduleFor, test } from 'ember-qunit';
 
 moduleFor('route:multi-am-pollster', 'Unit | Route | multi am pollster', {
@@ -30,3 +31,46 @@ test('Basic creation test', function(assert) {
   assert.ok(route.canPoll);
   assert.ok(route.actions.setPollingRecords);
 });
+
+test('canPoll test', function(assert) {
+  let record = Ember.Object.create({
+      }),
+      route = this.subject({
+        polling: {
+          resetPoll: function () {}
+        },
+        _canPollObserver: function () {},
+        polledRecords: Ember.A([record]),
+        loadedValue: {}
+      });
+
+  assert.notOk(route.get("canPoll"));
+
+  record.setProperties({
+    app: Ember.Object.create({
+      isComplete: false
+    }),
+    dag: undefined
+  });
+  assert.ok(route.get("canPoll"), true, "Test 1");
+
+  record.set("app.isComplete", true);
+  assert.notOk(route.get("canPoll"), "Test 2");
+
+  record.set("app.isComplete", undefined);
+  assert.notOk(route.get("canPoll"), "Test 3");
+
+  record.set("dag", Ember.Object.create({
+    isComplete: false
+  }));
+  assert.ok(route.get("canPoll"), "Test 4");
+
+  record.set("dag.isComplete", true);
+  assert.notOk(route.get("canPoll"), "Test 5");
+
+  record.set("dag", undefined);
+  assert.notOk(route.get("canPoll"), "Test 6");
+
+  record.set("app.isComplete", false);
+  assert.ok(route.get("canPoll"), "Test 7");
+});

http://git-wip-us.apache.org/repos/asf/tez/blob/359cd75c/tez-ui/src/main/webapp/tests/unit/routes/single-am-pollster-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/routes/single-am-pollster-test.js b/tez-ui/src/main/webapp/tests/unit/routes/single-am-pollster-test.js
index f9b3385..069c9fc 100644
--- a/tez-ui/src/main/webapp/tests/unit/routes/single-am-pollster-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/routes/single-am-pollster-test.js
@@ -48,16 +48,31 @@ test('canPoll test', function(assert) {
     loadedValue: {
       app: {
         isComplete: false
-      }
+      },
+      dag: undefined
     }
   });
-  assert.ok(route.get("canPoll"), true);
+  assert.ok(route.get("canPoll"), true, "Test 1");
 
   route.set("loadedValue.app.isComplete", true);
-  assert.notOk(route.get("canPoll"));
+  assert.notOk(route.get("canPoll"), "Test 2");
 
   route.set("loadedValue.app.isComplete", undefined);
-  assert.notOk(route.get("canPoll"));
+  assert.notOk(route.get("canPoll"), "Test 3");
+
+  route.set("loadedValue.dag", Ember.Object.create({
+    isComplete: false
+  }));
+  assert.ok(route.get("canPoll"), "Test 4");
+
+  route.set("loadedValue.dag.isComplete", true);
+  assert.notOk(route.get("canPoll"), "Test 5");
+
+  route.set("loadedValue.dag", undefined);
+  assert.notOk(route.get("canPoll"), "Test 6");
+
+  route.set("loadedValue.app.isComplete", false);
+  assert.ok(route.get("canPoll"), "Test 7");
 });
 
 test('_loadedValueObserver test', function(assert) {


Mime
View raw message