Repository: tez
Updated Branches:
  refs/heads/master 1225fd53a -> 536394726


TEZ-3714. Tez UI: Hive Queries page: Use Dag ID and App ID if they are 
published form Hive side. (sree)


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

Branch: refs/heads/master
Commit: 53639472660dd379f7ca91994e9b466f3994c651
Parents: 1225fd5
Author: Sreenath Somarajapuram <[email protected]>
Authored: Thu Jun 1 01:00:13 2017 +0530
Committer: Sreenath Somarajapuram <[email protected]>
Committed: Thu Jun 1 01:00:13 2017 +0530

----------------------------------------------------------------------
 tez-ui/src/main/webapp/app/adapters/timeline.js |  2 ++
 .../main/webapp/app/controllers/home/queries.js | 14 ++++----
 tez-ui/src/main/webapp/app/models/hive-query.js |  7 ++++
 .../src/main/webapp/app/routes/home/queries.js  | 34 ++------------------
 .../main/webapp/app/serializers/hive-query.js   |  2 ++
 .../webapp/tests/unit/adapters/timeline-test.js |  2 +-
 .../webapp/tests/unit/models/hive-query-test.js |  2 ++
 .../tests/unit/serializers/hive-query-test.js   |  2 +-
 8 files changed, 25 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/app/adapters/timeline.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/adapters/timeline.js 
b/tez-ui/src/main/webapp/app/adapters/timeline.js
index 2d8f474..605b0cb 100644
--- a/tez-ui/src/main/webapp/app/adapters/timeline.js
+++ b/tez-ui/src/main/webapp/app/adapters/timeline.js
@@ -33,6 +33,8 @@ export default AbstractAdapter.extend({
     attemptID: 'TEZ_TASK_ATTEMPT_ID',
     hiveQueryID: 'HIVE_QUERY_ID',
     appID: 'applicationId',
+    DAG_ID: "DAG_ID",
+    APP_ID: "APP_ID",
 
     dagName: 'dagName',
     user: "user",

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/app/controllers/home/queries.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/controllers/home/queries.js 
b/tez-ui/src/main/webapp/app/controllers/home/queries.js
index 9c0b564..ba7e6e3 100644
--- a/tez-ui/src/main/webapp/app/controllers/home/queries.js
+++ b/tez-ui/src/main/webapp/app/controllers/home/queries.js
@@ -112,14 +112,15 @@ export default TableController.extend({
   },{
     id: 'dagID',
     headerTitle: 'DAG ID',
-    contentPath: 'dag.firstObject.entityID',
+    contentPath: 'dagID',
     cellComponentName: 'em-table-linked-cell',
     minWidth: "250px",
     getCellContent: function (row) {
+      var dagID = row.get("dagID") || row.get("dag.firstObject.entityID");
       return {
         routeName: "dag",
-        model: row.get("dag.firstObject.entityID"),
-        text: row.get("dag.firstObject.entityID")
+        model: dagID,
+        text: dagID
       };
     }
   },{
@@ -160,13 +161,14 @@ export default TableController.extend({
   },{
     id: 'appID',
     headerTitle: 'Application Id',
-    contentPath: 'dag.firstObject.appID',
+    contentPath: 'appID',
     cellComponentName: 'em-table-linked-cell',
     getCellContent: function (row) {
+      var appID = row.get("appID") || row.get("dag.firstObject.appID");
       return {
         routeName: "app",
-        model: row.get("dag.firstObject.appID"),
-        text: row.get("dag.firstObject.appID")
+        model: appID,
+        text: appID
       };
     }
   },{

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/app/models/hive-query.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/models/hive-query.js 
b/tez-ui/src/main/webapp/app/models/hive-query.js
index 38b4785..4f742ef 100644
--- a/tez-ui/src/main/webapp/app/models/hive-query.js
+++ b/tez-ui/src/main/webapp/app/models/hive-query.js
@@ -32,6 +32,11 @@ export default AbstractModel.extend({
           callerId: model.get("entityID")
         };
       },
+      loadType: function (record) {
+        if(record.get("dagID")) {
+          return "demand";
+        }
+      },
     }
   },
 
@@ -39,6 +44,8 @@ export default AbstractModel.extend({
 
   dag: DS.attr('object'),
 
+  dagID: DS.attr('string'),
+  appID: DS.attr('string'),
   sessionID: DS.attr('string'),
   operationID: DS.attr('string'),
   llapAppID: DS.attr('string'),

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/app/routes/home/queries.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/routes/home/queries.js 
b/tez-ui/src/main/webapp/app/routes/home/queries.js
index 7d09a2e..f5f0ef7 100644
--- a/tez-ui/src/main/webapp/app/routes/home/queries.js
+++ b/tez-ui/src/main/webapp/app/routes/home/queries.js
@@ -42,8 +42,8 @@ export default ServerSideOpsRoute.extend({
 
   loaderQueryParams: {
     id: "queryID",
-    dagID: "dagID",
-    appID: "appID",
+    DAG_ID: "dagID",
+    APP_ID: "appID",
     executionMode: "executionMode",
     user: "user",
     requestuser: "requestUser",
@@ -60,36 +60,6 @@ export default ServerSideOpsRoute.extend({
 
   fromId: null,
 
-  load: function (value, query, options) {
-    var that = this;
-
-    if(query.dagID) {
-      return that.get("loader").queryRecord("dag", query.dagID).then(function 
(dag) {
-        return that.load(value, {
-          id: dag.get("callerID")
-        }, options);
-      }, function () {
-        return [];
-      });
-    }
-    else if(query.appID) {
-      return that.get("loader").query("dag", {
-        appID: query.appID,
-        limit: query.limit
-      }).then(function (dags) {
-        return Ember.RSVP.all(dags.map(function (dag) {
-          return that.get("loader").queryRecord("hive-query", 
dag.get("callerID"), options);
-        }));
-      }, function () {
-        return [];
-      });
-    }
-
-    return this._super(value, query, options).then(function (records) {
-      return records.toArray();
-    });
-  },
-
   setupController: function (controller, model) {
     this._super(controller, model);
     Ember.run.later(this, "startCrumbBubble");

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/app/serializers/hive-query.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/serializers/hive-query.js 
b/tez-ui/src/main/webapp/app/serializers/hive-query.js
index 787bfea..604d5ba 100644
--- a/tez-ui/src/main/webapp/app/serializers/hive-query.js
+++ b/tez-ui/src/main/webapp/app/serializers/hive-query.js
@@ -51,6 +51,8 @@ export default TimelineSerializer.extend({
   maps: {
     queryText: 'otherinfo.QUERY.queryText',
 
+    dagID: 'primaryfilters.DAG_ID',
+    appID: 'primaryfilters.APP_ID',
     sessionID: 'otherinfo.INVOKER_INFO',
     operationID: 'primaryfilters.operationid.0',
     llapAppID: 'otherinfo.LLAP_APP_ID',

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js 
b/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js
index 8f8fef6..a90be9d 100644
--- a/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/adapters/timeline-test.js
@@ -37,7 +37,7 @@ test('Basic creation test', function(assert) {
 
 test('filters test', function(assert) {
   let filters = this.subject().filters;
-  assert.equal(Object.keys(filters).length, 6 + 8 + 4);
+  assert.equal(Object.keys(filters).length, 8 + 8 + 4);
 });
 
 test('stringifyFilters test', function(assert) {

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/tests/unit/models/hive-query-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/models/hive-query-test.js 
b/tez-ui/src/main/webapp/tests/unit/models/hive-query-test.js
index 42803fd..2c87337 100644
--- a/tez-ui/src/main/webapp/tests/unit/models/hive-query-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/models/hive-query-test.js
@@ -42,6 +42,8 @@ test('Basic creation test', function(assert) {
 
   assert.ok(model.queryText);
 
+  assert.ok(model.dagID);
+
   assert.ok(model.configsJSON);
 
   assert.ok(model.startTime);

http://git-wip-us.apache.org/repos/asf/tez/blob/53639472/tez-ui/src/main/webapp/tests/unit/serializers/hive-query-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/serializers/hive-query-test.js 
b/tez-ui/src/main/webapp/tests/unit/serializers/hive-query-test.js
index 4544c72..c152589 100644
--- a/tez-ui/src/main/webapp/tests/unit/serializers/hive-query-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/serializers/hive-query-test.js
@@ -26,7 +26,7 @@ moduleFor('serializer:hive-query', 'Unit | Serializer | hive 
query', {
 
 test('Basic creation test', function(assert) {
   let serializer = this.subject();
-  assert.equal(Object.keys(serializer.get("maps")).length, 6 + 21);
+  assert.equal(Object.keys(serializer.get("maps")).length, 23 + 6); // 23 own 
and 6 inherited
   assert.ok(serializer.get("extractAttributes"));
 });
 

Reply via email to