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/24 23:34:57 UTC
[20/45] tez git commit: TEZ-3039. Tez UI 2: Create all sub-pages for
DAG (sree)
TEZ-3039. Tez UI 2: Create all sub-pages for DAG (sree)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/a1c3622a
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/a1c3622a
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/a1c3622a
Branch: refs/heads/TEZ-2980
Commit: a1c3622abdcb70151314bb272bcb0ece12b337b0
Parents: a0ba39c
Author: Sreenath Somarajapuram <sr...@apache.org>
Authored: Mon Jan 18 21:25:54 2016 +0530
Committer: Sreenath Somarajapuram <sr...@apache.org>
Committed: Thu Feb 25 03:32:15 2016 +0530
----------------------------------------------------------------------
TEZ-2980-CHANGES.txt | 1 +
tez-ui2/src/main/webapp/app/adapters/attempt.js | 22 ++++++
tez-ui2/src/main/webapp/app/adapters/task.js | 22 ++++++
.../src/main/webapp/app/adapters/timeline.js | 77 +++++++++++++++++++-
tez-ui2/src/main/webapp/app/adapters/vertex.js | 22 ++++++
.../main/webapp/app/controllers/dag/attempts.js | 61 +++++++++++++++-
.../main/webapp/app/controllers/dag/tasks.js | 49 ++++++++++++-
.../main/webapp/app/controllers/dag/vertices.js | 61 +++++++++++++++-
tez-ui2/src/main/webapp/app/controllers/dags.js | 2 +-
.../main/webapp/app/controllers/table-page.js | 15 +++-
tez-ui2/src/main/webapp/app/models/attempt.js | 71 ++++++++++++++++++
tez-ui2/src/main/webapp/app/models/dag.js | 2 +
tez-ui2/src/main/webapp/app/models/task.js | 62 ++++++++++++++++
tez-ui2/src/main/webapp/app/models/vertex.js | 61 ++++++++++++++++
.../src/main/webapp/app/routes/dag/attempts.js | 8 +-
tez-ui2/src/main/webapp/app/routes/dag/tasks.js | 8 +-
.../src/main/webapp/app/routes/dag/vertices.js | 8 +-
.../src/main/webapp/app/serializers/attempt.js | 30 ++++++++
tez-ui2/src/main/webapp/app/serializers/dag.js | 21 +++++-
tez-ui2/src/main/webapp/app/serializers/task.js | 26 +++++++
.../src/main/webapp/app/serializers/timeline.js | 13 ++++
.../src/main/webapp/app/serializers/vertex.js | 44 +++++++++++
.../main/webapp/app/templates/dag/attempts.hbs | 16 +++-
.../src/main/webapp/app/templates/dag/tasks.hbs | 16 +++-
.../main/webapp/app/templates/dag/vertices.hbs | 16 +++-
.../src/main/webapp/config/default-app-conf.js | 3 +-
.../webapp/tests/unit/adapters/attempt-test.js | 30 ++++++++
.../webapp/tests/unit/adapters/task-test.js | 29 ++++++++
.../webapp/tests/unit/adapters/timeline-test.js | 53 ++++++++++++++
.../webapp/tests/unit/adapters/vertex-test.js | 30 ++++++++
.../tests/unit/controllers/dag/attempts-test.js | 1 +
.../tests/unit/controllers/dag/tasks-test.js | 1 +
.../tests/unit/controllers/dag/vertices-test.js | 1 +
.../webapp/tests/unit/models/attempt-test.js | 63 ++++++++++++++++
.../main/webapp/tests/unit/models/task-test.js | 55 ++++++++++++++
.../webapp/tests/unit/models/vertex-test.js | 48 ++++++++++++
.../tests/unit/routes/dag/attempts-test.js | 1 +
.../webapp/tests/unit/routes/dag/tasks-test.js | 1 +
.../tests/unit/routes/dag/vertices-test.js | 1 +
.../tests/unit/serializers/attempt-test.js | 31 ++++++++
.../webapp/tests/unit/serializers/dag-test.js | 22 ++++++
.../webapp/tests/unit/serializers/task-test.js | 31 ++++++++
.../tests/unit/serializers/timeline-test.js | 1 +
.../tests/unit/serializers/vertex-test.js | 49 +++++++++++++
44 files changed, 1163 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/TEZ-2980-CHANGES.txt
----------------------------------------------------------------------
diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt
index 925dc7f..372369a 100644
--- a/TEZ-2980-CHANGES.txt
+++ b/TEZ-2980-CHANGES.txt
@@ -14,3 +14,4 @@ ALL CHANGES:
TEZ-3027. Tez UI 2: Add header and footer elements
TEZ-2986. Tez UI 2: Implement All DAGs page
TEZ-3038. Tez UI 2: Create DAG details page
+ TEZ-3039. Tez UI 2: Create all sub-pages for DAG
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/adapters/attempt.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/adapters/attempt.js b/tez-ui2/src/main/webapp/app/adapters/attempt.js
new file mode 100644
index 0000000..b47e05f
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/adapters/attempt.js
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import TimelineAdapter from './timeline';
+
+export default TimelineAdapter.extend({
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/adapters/task.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/adapters/task.js b/tez-ui2/src/main/webapp/app/adapters/task.js
new file mode 100644
index 0000000..b47e05f
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/adapters/task.js
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import TimelineAdapter from './timeline';
+
+export default TimelineAdapter.extend({
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/adapters/timeline.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/adapters/timeline.js b/tez-ui2/src/main/webapp/app/adapters/timeline.js
index 454cbc9..6e06c7b 100644
--- a/tez-ui2/src/main/webapp/app/adapters/timeline.js
+++ b/tez-ui2/src/main/webapp/app/adapters/timeline.js
@@ -1,3 +1,5 @@
+/*global more*/
+
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,8 +20,81 @@
import AbstractAdapter from './abstract';
+var MoreObject = more.Object;
+
export default AbstractAdapter.extend({
serverName: "timeline",
- // Any timeline specific adapter changes must be added here
+ filters: {
+ dagID: 'TEZ_DAG_ID',
+ vertexID: 'TEZ_VERTEX_ID',
+ taskID: 'TEZ_TASK_ID',
+ attemptID: 'TEZ_TASK_ATTEMPT_ID',
+ hiveQueryID: 'HIVE_QUERY_ID',
+ appID: 'applicationId'
+ },
+
+ stringifyFilters: function (filters) {
+ var filterStrs = [];
+
+ MoreObject.forEach(filters, function (key, value) {
+ filterStrs.push(`${key}:${value}`);
+ });
+
+ return filterStrs.join(",");
+ },
+
+ normalizeQuery: function(query) {
+ var primaryFilter = null, // Primary must have just one single filter
+ secondaryFilters = {},
+ normalQuery = {},
+ filterStr;
+
+ MoreObject.forEach(query, function (key, value) {
+ var filter = this.get(`filters.${key}`);
+
+ if(filter) {
+ if(!primaryFilter) {
+ primaryFilter = {};
+ primaryFilter[filter] = value;
+ }
+ else {
+ secondaryFilters[filter] = value;
+ }
+ }
+ else {
+ normalQuery[key] = value;
+ }
+ }, this);
+
+ // primaryFilter
+ if(primaryFilter) {
+ filterStr = this.stringifyFilters(primaryFilter);
+ }
+ if(filterStr) {
+ normalQuery.primaryFilter = filterStr;
+ }
+
+ // secondaryFilters
+ filterStr = this.stringifyFilters(secondaryFilters);
+ if(filterStr) {
+ normalQuery.secondaryFilter = filterStr;
+ }
+
+ // Limit
+ normalQuery.limit = normalQuery.limit || this.get("env.app.rowLoadLimit");
+
+ return normalQuery;
+ },
+
+ query: function (store, type, query/*, recordArray*/) {
+ var queryParams = query.params,
+ url = this.buildURL(type.modelName, null, null, 'query', queryParams, query.urlParams);
+
+ if(query) {
+ queryParams = this.normalizeQuery(queryParams);
+ }
+
+ return this._loaderAjax(url, queryParams, query.nameSpace);
+ }
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/adapters/vertex.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/adapters/vertex.js b/tez-ui2/src/main/webapp/app/adapters/vertex.js
new file mode 100644
index 0000000..b47e05f
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/adapters/vertex.js
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import TimelineAdapter from './timeline';
+
+export default TimelineAdapter.extend({
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/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 d5efc50..1ffc00c 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js
@@ -16,11 +16,66 @@
* limitations under the License.
*/
-import PageController from '../page';
+import TablePageController from '../table-page';
+import ColumnDefinition from 'em-table/utils/column-definition';
-export default PageController.extend({
+export default TablePageController.extend({
breadcrumbs: [{
text: "All Attempts",
routeName: "dag.attempts",
- }]
+ }],
+
+ columns: ColumnDefinition.make([{
+ id: 'index',
+ headerTitle: 'Attempt No',
+ contentPath: 'index'
+ },{
+ id: 'taskIndex',
+ headerTitle: 'Task Index',
+ contentPath: 'taskIndex'
+ },{
+ id: 'vertexName',
+ headerTitle: 'Vertex Index',
+ contentPath: 'vertexName'
+ },{
+ id: 'status',
+ headerTitle: 'Status',
+ contentPath: 'status',
+ cellComponentName: 'em-table-status-cell'
+ },{
+ id: 'progress',
+ headerTitle: 'Progress',
+ contentPath: 'progress',
+ cellComponentName: 'em-table-progress-cell',
+ observePath: true
+ },{
+ id: 'startTime',
+ headerTitle: 'Start Time',
+ contentPath: 'startTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'endTime',
+ headerTitle: 'End Time',
+ contentPath: 'endTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'duration',
+ headerTitle: 'Duration',
+ contentPath: 'duration',
+ cellDefinition: {
+ type: 'duration'
+ }
+ },{
+ id: 'containerID',
+ headerTitle: 'Container',
+ contentPath: 'containerID'
+ },{
+ id: 'nodeID',
+ headerTitle: 'Node',
+ contentPath: 'nodeID'
+ }])
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js b/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js
index e83df5d..7c91deb 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js
@@ -16,11 +16,54 @@
* limitations under the License.
*/
-import PageController from '../page';
+import TablePageController from '../table-page';
+import ColumnDefinition from 'em-table/utils/column-definition';
-export default PageController.extend({
+export default TablePageController.extend({
breadcrumbs: [{
text: "All Tasks",
routeName: "dag.tasks",
- }]
+ }],
+
+ columns: ColumnDefinition.make([{
+ id: 'index',
+ headerTitle: 'Task Index',
+ contentPath: 'index'
+ },{
+ id: 'vertexName',
+ headerTitle: 'Vertex Name',
+ contentPath: 'vertexName'
+ },{
+ id: 'status',
+ headerTitle: 'Status',
+ contentPath: 'status',
+ cellComponentName: 'em-table-status-cell'
+ },{
+ id: 'progress',
+ headerTitle: 'Progress',
+ contentPath: 'progress',
+ cellComponentName: 'em-table-progress-cell',
+ observePath: true
+ },{
+ id: 'startTime',
+ headerTitle: 'Start Time',
+ contentPath: 'startTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'endTime',
+ headerTitle: 'End Time',
+ contentPath: 'endTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'duration',
+ headerTitle: 'Duration',
+ contentPath: 'duration',
+ cellDefinition: {
+ type: 'duration'
+ }
+ }])
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/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 e001652..7bdc229 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js
@@ -16,11 +16,66 @@
* limitations under the License.
*/
-import PageController from '../page';
+import TablePageController from '../table-page';
+import ColumnDefinition from 'em-table/utils/column-definition';
-export default PageController.extend({
+export default TablePageController.extend({
breadcrumbs: [{
text: "All Vertices",
routeName: "dag.vertices",
- }]
+ }],
+
+ columns: ColumnDefinition.make([{
+ id: 'name',
+ headerTitle: 'Vertex Name',
+ contentPath: 'name',
+ },{
+ id: 'entityID',
+ headerTitle: 'Vertex Id',
+ contentPath: 'entityID'
+ },{
+ id: 'status',
+ headerTitle: 'Status',
+ contentPath: 'status',
+ cellComponentName: 'em-table-status-cell'
+ },{
+ id: 'progress',
+ headerTitle: 'Progress',
+ contentPath: 'progress',
+ cellComponentName: 'em-table-progress-cell',
+ observePath: true
+ },{
+ id: 'startTime',
+ headerTitle: 'Start Time',
+ contentPath: 'startTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'endTime',
+ headerTitle: 'End Time',
+ contentPath: 'endTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'duration',
+ headerTitle: 'Duration',
+ contentPath: 'duration',
+ cellDefinition: {
+ type: 'duration'
+ }
+ },{
+ id: 'firstTaskStartTime',
+ headerTitle: 'First Task Start Time',
+ contentPath: 'firstTaskStartTime',
+ cellDefinition: {
+ type: 'date'
+ }
+ },{
+ id: 'processorClassName',
+ headerTitle: 'Processor Class',
+ contentPath: 'processorClassName',
+ }])
+
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/controllers/dags.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/dags.js b/tez-ui2/src/main/webapp/app/controllers/dags.js
index 354f4f8..8d7e73e 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dags.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dags.js
@@ -24,7 +24,7 @@ export default TablePageController.extend({
breadcrumbs: [],
columns: ColumnDefinition.make([{
- id: 'dagName',
+ id: 'name',
headerTitle: 'Dag Name',
contentPath: 'name',
cellComponentName: 'em-table-linked-cell',
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/controllers/table-page.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/table-page.js b/tez-ui2/src/main/webapp/app/controllers/table-page.js
index 14219d9..1f2fe57 100644
--- a/tez-ui2/src/main/webapp/app/controllers/table-page.js
+++ b/tez-ui2/src/main/webapp/app/controllers/table-page.js
@@ -16,7 +16,10 @@
* limitations under the License.
*/
+import Ember from 'ember';
+
import PageController from './page';
+import TableDefinition from 'em-table/utils/table-definition';
export default PageController.extend({
queryParams: ["rowCount", "searchText", "sortColumnId", "sortOrder", "pageNo"],
@@ -26,6 +29,16 @@ export default PageController.extend({
sortOrder: "",
pageNo: 1,
+ definition: Ember.computed(function () {
+ return TableDefinition.create({
+ rowCount: this.get("rowCount"),
+ searchText: this.get("searchText"),
+ sortColumnId: this.get("sortColumnId"),
+ sortOrder: this.get("sortOrder"),
+ pageNo: this.get("pageNo")
+ });
+ }),
+
actions: {
searchChanged: function (searchText) {
this.set("searchText", searchText);
@@ -41,7 +54,7 @@ export default PageController.extend({
this.set("rowCount", rowCount);
},
pageChanged: function (pageNum) {
- this.set("pageNum", pageNum);
+ this.set("pageNo", pageNum);
},
}
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/models/attempt.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/models/attempt.js b/tez-ui2/src/main/webapp/app/models/attempt.js
new file mode 100644
index 0000000..eb99169
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/models/attempt.js
@@ -0,0 +1,71 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import DS from 'ember-data';
+
+import TimelineModel from './timeline';
+/*
+ Inherited properties
+
+ entityID - String
+ appID - Computed from entityID
+
+ status - String
+ progress - Computed from status
+
+ startTime - Number
+ endTime - Number
+ duration - Computed from start & end times
+
+ counterGroups - Array
+ counterHash - Computed from counterGroups
+*/
+
+export default TimelineModel.extend({
+ needs: {
+ dag: {
+ type: "dag",
+ idKey: "dagID",
+ silent: true
+ }
+ },
+
+ index: Ember.computed("entityID", function () {
+ var idParts = this.get("entityID").split("_");
+ return idParts[Math.max(idParts.length - 1, 1)];
+ }),
+
+ taskID: DS.attr('string'),
+ taskIndex: Ember.computed("taskID", function () {
+ var idParts = this.get("taskID").split("_");
+ return idParts.slice(Math.max(idParts.length - 2, 1)).join("_");
+ }),
+
+ vertexID: DS.attr('string'),
+ vertexName: Ember.computed("vertexID", "dag", function () {
+ var vertexID = this.get("vertexID");
+ return this.get(`dag.vertexIdNameMap.${vertexID}`);
+ }),
+
+ dagID: DS.attr('string'),
+ dag: DS.attr('object'), // Auto-loaded by need
+
+ containerID: DS.attr('string'),
+ nodeID: DS.attr('string'),
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/models/dag.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/models/dag.js b/tez-ui2/src/main/webapp/app/models/dag.js
index 4e9ff7c..2efb65f 100644
--- a/tez-ui2/src/main/webapp/app/models/dag.js
+++ b/tez-ui2/src/main/webapp/app/models/dag.js
@@ -48,4 +48,6 @@ export default TimelineModel.extend({
queue: Ember.computed("app", function () {
return this.get("app.queue");
}),
+
+ vertexIdNameMap: DS.attr("object"),
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/models/task.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/models/task.js b/tez-ui2/src/main/webapp/app/models/task.js
new file mode 100644
index 0000000..2ded910
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/models/task.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import DS from 'ember-data';
+
+import TimelineModel from './timeline';
+/*
+ Inherited properties
+
+ entityID - String
+ appID - Computed from entityID
+
+ status - String
+ progress - Computed from status
+
+ startTime - Number
+ endTime - Number
+ duration - Computed from start & end times
+
+ counterGroups - Array
+ counterHash - Computed from counterGroups
+*/
+
+export default TimelineModel.extend({
+ needs: {
+ dag: {
+ type: "dag",
+ idKey: "dagID",
+ silent: true
+ }
+ },
+
+ index: Ember.computed("entityID", function () {
+ var idParts = this.get("entityID").split("_");
+ return idParts.slice(Math.max(idParts.length - 2, 1)).join("_");
+ }),
+
+ vertexID: DS.attr('string'),
+ vertexName: Ember.computed("vertexID", "dag", function () {
+ var vertexID = this.get("vertexID");
+ return this.get(`dag.vertexIdNameMap.${vertexID}`);
+ }),
+
+ dagID: DS.attr('string'),
+ dag: DS.attr('object'), // Auto-loaded by need
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/models/vertex.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/models/vertex.js b/tez-ui2/src/main/webapp/app/models/vertex.js
new file mode 100644
index 0000000..dcdb0f2
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/models/vertex.js
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import DS from 'ember-data';
+
+import TimelineModel from './timeline';
+/*
+ Inherited properties
+
+ entityID - String
+ appID - Computed from entityID
+
+ status - String
+ progress - Computed from status
+
+ startTime - Number
+ endTime - Number
+ duration - Computed from start & end times
+
+ counterGroups - Array
+ counterHash - Computed from counterGroups
+*/
+
+export default TimelineModel.extend({
+ name: DS.attr('string'),
+
+ firstTaskStartTime: DS.attr('number'),
+
+ numTasks: DS.attr('number'),
+ failedTasks: DS.attr('number'),
+ sucessfulTasks: DS.attr('number'),
+ killedTasks: DS.attr('number'),
+
+ runningTasks: Ember.computed("status", function () {
+ return this.get("status") === 'SUCCEEDED' ? 0 : null;
+ }),
+ pendingTasks: Ember.computed("status", function () {
+ return this.get("status") === 'SUCCEEDED' ? 0 : null;
+ }),
+
+ failedTaskAttempts: DS.attr('number'),
+ killedTaskAttempts: DS.attr('number'),
+
+ processorClassName: DS.attr('string'),
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/routes/dag/attempts.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/routes/dag/attempts.js b/tez-ui2/src/main/webapp/app/routes/dag/attempts.js
index 5de1cab..3a05867 100644
--- a/tez-ui2/src/main/webapp/app/routes/dag/attempts.js
+++ b/tez-ui2/src/main/webapp/app/routes/dag/attempts.js
@@ -20,10 +20,16 @@ import Ember from 'ember';
import AbstractRoute from '../abstract';
export default AbstractRoute.extend({
- title: "DAG Details",
+ title: "All Attempts",
setupController: function (controller, model) {
this._super(controller, model);
Ember.run.later(this, "startCrumbBubble");
},
+
+ load: function (/*value, query*/) {
+ return this.get("loader").query('attempt', {
+ dagID: this.modelFor("dag").id
+ });
+ }
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/routes/dag/tasks.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/routes/dag/tasks.js b/tez-ui2/src/main/webapp/app/routes/dag/tasks.js
index 5de1cab..3408a3e 100644
--- a/tez-ui2/src/main/webapp/app/routes/dag/tasks.js
+++ b/tez-ui2/src/main/webapp/app/routes/dag/tasks.js
@@ -20,10 +20,16 @@ import Ember from 'ember';
import AbstractRoute from '../abstract';
export default AbstractRoute.extend({
- title: "DAG Details",
+ title: "All Tasks",
setupController: function (controller, model) {
this._super(controller, model);
Ember.run.later(this, "startCrumbBubble");
},
+
+ load: function (/*value, query*/) {
+ return this.get("loader").query('task', {
+ dagID: this.modelFor("dag").id
+ });
+ }
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/routes/dag/vertices.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/routes/dag/vertices.js b/tez-ui2/src/main/webapp/app/routes/dag/vertices.js
index 5de1cab..e8c0770 100644
--- a/tez-ui2/src/main/webapp/app/routes/dag/vertices.js
+++ b/tez-ui2/src/main/webapp/app/routes/dag/vertices.js
@@ -20,10 +20,16 @@ import Ember from 'ember';
import AbstractRoute from '../abstract';
export default AbstractRoute.extend({
- title: "DAG Details",
+ title: "All Vertices",
setupController: function (controller, model) {
this._super(controller, model);
Ember.run.later(this, "startCrumbBubble");
},
+
+ load: function (/*value, query*/) {
+ return this.get("loader").query('vertex', {
+ dagID: this.modelFor("dag").id
+ });
+ }
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/serializers/attempt.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/serializers/attempt.js b/tez-ui2/src/main/webapp/app/serializers/attempt.js
new file mode 100644
index 0000000..d7e2a7d
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/serializers/attempt.js
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import TimelineSerializer from './timeline';
+
+export default TimelineSerializer.extend({
+ maps: {
+ taskID: 'primaryfilters.TEZ_TASK_ID.0',
+ vertexID: 'primaryfilters.TEZ_VERTEX_ID.0',
+ dagID: 'primaryfilters.TEZ_DAG_ID.0',
+
+ containerID: 'otherinfo.containerId',
+ nodeID: 'otherinfo.nodeId',
+ }
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/serializers/dag.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/serializers/dag.js b/tez-ui2/src/main/webapp/app/serializers/dag.js
index 35c53ba..00113e4 100644
--- a/tez-ui2/src/main/webapp/app/serializers/dag.js
+++ b/tez-ui2/src/main/webapp/app/serializers/dag.js
@@ -1,3 +1,4 @@
+/*global more*/
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +21,8 @@ import Ember from 'ember';
import TimelineSerializer from './timeline';
+var MoreObject = more.Object;
+
function getStatus(source) {
var status = Ember.get(source, 'otherinfo.status') || Ember.get(source, 'primaryfilters.status.0'),
event = source.events;
@@ -86,9 +89,21 @@ function getContainerLogs(source) {
return containerLogs;
}
+function getIdNameMap(source) {
+ var nameIdMap = Ember.get(source, 'otherinfo.vertexNameIdMapping'),
+ idNameMap = {};
+
+ if(nameIdMap) {
+ MoreObject.forEach(nameIdMap, function (name, id) {
+ idNameMap[id] = name;
+ });
+ }
+
+ return idNameMap;
+}
+
export default TimelineSerializer.extend({
maps: {
- entityID: 'entity',
name: 'primaryfilters.dagName.0',
user: 'primaryfilters.user.0',
@@ -101,11 +116,11 @@ export default TimelineSerializer.extend({
endTime: getEndTime,
// duration
- appID: 'otherinfo.applicationId',
+ // appID
domain: 'domain',
// queue
containerLogs: getContainerLogs,
- counterGroups: 'otherinfo.counters.counterGroups'
+ vertexIdNameMap: getIdNameMap
}
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/serializers/task.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/serializers/task.js b/tez-ui2/src/main/webapp/app/serializers/task.js
new file mode 100644
index 0000000..7918e89
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/serializers/task.js
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import TimelineSerializer from './timeline';
+
+export default TimelineSerializer.extend({
+ maps: {
+ vertexID: 'primaryfilters.TEZ_VERTEX_ID.0',
+ dagID: 'primaryfilters.TEZ_DAG_ID.0',
+ }
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/serializers/timeline.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/serializers/timeline.js b/tez-ui2/src/main/webapp/app/serializers/timeline.js
index 27f1894..7e20317 100644
--- a/tez-ui2/src/main/webapp/app/serializers/timeline.js
+++ b/tez-ui2/src/main/webapp/app/serializers/timeline.js
@@ -21,7 +21,20 @@ import LoaderSerializer from './loader';
export default LoaderSerializer.extend({
primaryKey: 'entity',
+ mergedProperties: ["maps"],
+
extractArrayPayload: function (payload) {
return payload.entities;
+ },
+
+ maps: {
+ entityID: 'entity',
+
+ atsStatus: 'otherinfo.status',
+
+ startTime: 'otherinfo.startTime',
+ endTime: 'otherinfo.endTime',
+
+ counterGroups: 'otherinfo.counters.counterGroups'
}
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/serializers/vertex.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/serializers/vertex.js b/tez-ui2/src/main/webapp/app/serializers/vertex.js
new file mode 100644
index 0000000..88ee5d3
--- /dev/null
+++ b/tez-ui2/src/main/webapp/app/serializers/vertex.js
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+import TimelineSerializer from './timeline';
+
+function getProcessorClass(source) {
+ var name = Ember.get(source, 'otherinfo.processorClassName') || "";
+ return name.substr(name.lastIndexOf('.') + 1);
+}
+
+export default TimelineSerializer.extend({
+ maps: {
+ name: 'otherinfo.vertexName',
+
+ firstTaskStartTime: 'otherinfo.stats.firstTaskStartTime',
+
+ numTasks: 'otherinfo.numTasks',
+ failedTasks: 'otherinfo.numFailedTasks',
+ sucessfulTasks: 'otherinfo.numSucceededTasks',
+ killedTasks: 'otherinfo.numKilledTasks',
+
+ failedTaskAttempts: 'otherinfo.numFailedTaskAttempts',
+ killedTaskAttempts: 'otherinfo.numKilledTaskAttempts',
+
+ processorClassName: getProcessorClass,
+ }
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs b/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs
index 63840f5..932db09 100644
--- a/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs
+++ b/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs
@@ -16,4 +16,18 @@
* limitations under the License.
}}
-Attempts
\ No newline at end of file
+{{#if loaded}}
+ {{em-table
+ columns=columns
+ rows=model
+
+ definition=definition
+
+ searchAction="searchChanged"
+ sortAction="sortChanged"
+ rowAction="rowsChanged"
+ pageAction="pageChanged"
+ }}
+{{else}}
+ {{partial "partials/loading-anim"}}
+{{/if}}
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs b/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs
index daee5b5..932db09 100644
--- a/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs
+++ b/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs
@@ -16,4 +16,18 @@
* limitations under the License.
}}
-Tasks
\ No newline at end of file
+{{#if loaded}}
+ {{em-table
+ columns=columns
+ rows=model
+
+ definition=definition
+
+ searchAction="searchChanged"
+ sortAction="sortChanged"
+ rowAction="rowsChanged"
+ pageAction="pageChanged"
+ }}
+{{else}}
+ {{partial "partials/loading-anim"}}
+{{/if}}
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs b/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs
index 7f0bd85..932db09 100644
--- a/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs
+++ b/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs
@@ -16,4 +16,18 @@
* limitations under the License.
}}
-Vertices
\ No newline at end of file
+{{#if loaded}}
+ {{em-table
+ columns=columns
+ rows=model
+
+ definition=definition
+
+ searchAction="searchChanged"
+ sortAction="sortChanged"
+ rowAction="rowsChanged"
+ pageAction="pageChanged"
+ }}
+{{else}}
+ {{partial "partials/loading-anim"}}
+{{/if}}
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/config/default-app-conf.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/config/default-app-conf.js b/tez-ui2/src/main/webapp/config/default-app-conf.js
index e3d9076..feea181 100644
--- a/tez-ui2/src/main/webapp/config/default-app-conf.js
+++ b/tez-ui2/src/main/webapp/config/default-app-conf.js
@@ -19,6 +19,7 @@
module.exports = { // Tez App configurations
buildVersion: "",
isStandalone: true, // Must be set false while running in wrapped mode
+ rowLoadLimit: 9007199254740991,
hosts: {
timeline: 'localhost:8188',
rm: 'localhost:8088',
@@ -39,7 +40,7 @@ module.exports = { // Tez App configurations
dag: 'TEZ_DAG_ID',
vertex: 'TEZ_VERTEX_ID',
task: 'TEZ_TASK_ID',
- taskAttempt: 'TEZ_TASK_ATTEMPT_ID',
+ attempt: 'TEZ_TASK_ATTEMPT_ID',
hiveQuery: 'HIVE_QUERY_ID',
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/adapters/attempt-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/adapters/attempt-test.js b/tez-ui2/src/main/webapp/tests/unit/adapters/attempt-test.js
new file mode 100644
index 0000000..584c46e
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/adapters/attempt-test.js
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('adapter:attempt', 'Unit | Adapter | attempt', {
+ // Specify the other units that are required for this test.
+ // needs: ['serializer:foo']
+});
+
+test('Basic creation test', function(assert) {
+ let adapter = this.subject();
+
+ assert.ok(adapter);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/adapters/task-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/adapters/task-test.js b/tez-ui2/src/main/webapp/tests/unit/adapters/task-test.js
new file mode 100644
index 0000000..ca39e56
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/adapters/task-test.js
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('adapter:task', 'Unit | Adapter | task', {
+ // Specify the other units that are required for this test.
+ // needs: ['serializer:foo']
+});
+
+test('Basic creation test', function(assert) {
+ let adapter = this.subject();
+ assert.ok(adapter);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js b/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js
index 9b1a8de..7b0e978 100644
--- a/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js
@@ -27,5 +27,58 @@ test('Basic creation test', function(assert) {
let adapter = this.subject();
assert.ok(adapter);
+ assert.ok(adapter.filters);
+ assert.ok(adapter.stringifyFilters);
+ assert.ok(adapter.normalizeQuery);
+ assert.ok(adapter.query);
+
assert.equal(adapter.serverName, "timeline");
});
+
+test('stringifyFilters test', function(assert) {
+ let adapter = this.subject();
+
+ assert.equal(adapter.stringifyFilters({a: 1, b: 2}), "a:1,b:2");
+ assert.throws(function () {
+ adapter.stringifyFilters();
+ });
+});
+
+test('normalizeQuery test', function(assert) {
+ let adapter = this.subject(),
+ normalQuery;
+
+ adapter.set("filters", {
+ a: "A_ID",
+ b: "B_ID",
+ });
+
+ normalQuery = adapter.normalizeQuery({a: 1, b: 2, c: 3, d: 4});
+
+ assert.deepEqual(normalQuery.primaryFilter, "A_ID:1");
+ assert.deepEqual(normalQuery.secondaryFilter, "B_ID:2");
+ assert.deepEqual(normalQuery.c, 3);
+ assert.deepEqual(normalQuery.d, 4);
+});
+
+test('query test', function(assert) {
+ let adapter = this.subject(),
+ normalQuery = {},
+ testStore = {},
+ testType = "ts",
+ testQuery = {};
+
+ assert.expect(1 + 1);
+
+ adapter.normalizeQuery = function (params) {
+ assert.equal(params, testQuery);
+ return normalQuery;
+ };
+ adapter._loaderAjax = function (url, queryParams) {
+ assert.equal(queryParams, normalQuery);
+ };
+
+ adapter.query(testStore, testType, {
+ params: testQuery
+ });
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/adapters/vertex-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/adapters/vertex-test.js b/tez-ui2/src/main/webapp/tests/unit/adapters/vertex-test.js
new file mode 100644
index 0000000..191f781
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/adapters/vertex-test.js
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('adapter:vertex', 'Unit | Adapter | vertex', {
+ // Specify the other units that are required for this test.
+ // needs: ['serializer:foo']
+});
+
+test('Basic creation test', function(assert) {
+ let adapter = this.subject();
+
+ assert.ok(adapter);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/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 1908e69..11bb0fa 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
@@ -32,4 +32,5 @@ test('Basic creation test', function(assert) {
assert.ok(controller);
assert.ok(controller.breadcrumbs);
+ assert.ok(controller.columns);
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js
index 9d22331..073e3d3 100644
--- a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js
@@ -32,4 +32,5 @@ test('Basic creation test', function(assert) {
assert.ok(controller);
assert.ok(controller.breadcrumbs);
+ assert.ok(controller.columns);
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/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 ca6d3d9..fc75935 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
@@ -32,4 +32,5 @@ test('Basic creation test', function(assert) {
assert.ok(controller);
assert.ok(controller.breadcrumbs);
+ assert.ok(controller.columns);
});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/models/attempt-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/models/attempt-test.js b/tez-ui2/src/main/webapp/tests/unit/models/attempt-test.js
new file mode 100644
index 0000000..7d0a78e
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/models/attempt-test.js
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('attempt', 'Unit | Model | attempt', {
+ // Specify the other units that are required for this test.
+ needs: []
+});
+
+test('Basic creation test', function(assert) {
+ let model = this.subject();
+
+ assert.ok(model);
+ assert.ok(model.index);
+ assert.ok(model.taskIndex);
+ assert.ok(model.vertexName);
+});
+
+test('index test', function(assert) {
+ let model = this.subject({
+ entityID: "1_2_3"
+ });
+
+ assert.equal(model.get("index"), "3");
+});
+
+test('taskIndex test', function(assert) {
+ let model = this.subject({
+ taskID: "1_2_3",
+ });
+
+ assert.equal(model.get("taskIndex"), "2_3");
+});
+
+test('vertexName test', function(assert) {
+ let testVertexName = "Test Vertex",
+ model = this.subject({
+ vertexID: "1_2",
+ dag: {
+ vertexIdNameMap: {
+ "1_2": testVertexName
+ }
+ }
+ });
+
+ assert.equal(model.get("vertexName"), testVertexName);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/models/task-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/models/task-test.js b/tez-ui2/src/main/webapp/tests/unit/models/task-test.js
new file mode 100644
index 0000000..3d59df6
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/models/task-test.js
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('task', 'Unit | Model | task', {
+ // Specify the other units that are required for this test.
+ needs: []
+});
+
+test('Basic creation test', function(assert) {
+ let model = this.subject();
+
+ assert.ok(model);
+ assert.ok(model.needs);
+ assert.ok(model.index);
+ assert.ok(model.vertexName);
+});
+
+test('index test', function(assert) {
+ let model = this.subject({
+ entityID: "1_2_3",
+ });
+
+ assert.equal(model.get("index"), "2_3");
+});
+
+test('vertexName test', function(assert) {
+ let testVertexName = "Test Vertex",
+ model = this.subject({
+ vertexID: "1_2",
+ dag: {
+ vertexIdNameMap: {
+ "1_2": testVertexName
+ }
+ }
+ });
+
+ assert.equal(model.get("vertexName"), testVertexName);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/models/vertex-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/models/vertex-test.js b/tez-ui2/src/main/webapp/tests/unit/models/vertex-test.js
new file mode 100644
index 0000000..bea4317
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/models/vertex-test.js
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('vertex', 'Unit | Model | vertex', {
+ // Specify the other units that are required for this test.
+ needs: []
+});
+
+test('Basic creation test', function(assert) {
+ let model = this.subject();
+
+ assert.ok(model);
+ assert.ok(model.runningTasks);
+ assert.ok(model.pendingTasks);
+});
+
+test('runningTasks test', function(assert) {
+ let model = this.subject();
+
+ assert.equal(model.get("runningTasks"), null);
+ model.set("status", "SUCCEEDED");
+ assert.equal(model.get("runningTasks"), 0);
+});
+
+test('pendingTasks test', function(assert) {
+ let model = this.subject();
+
+ assert.equal(model.get("pendingTasks"), null);
+ model.set("status", "SUCCEEDED");
+ assert.equal(model.get("pendingTasks"), 0);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js
index f997891..36a67b4 100644
--- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js
@@ -29,6 +29,7 @@ test('Basic creation test', function(assert) {
assert.ok(route);
assert.ok(route.title);
assert.ok(route.setupController);
+ assert.ok(route.load);
});
test('setupController test', function(assert) {
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js
index 3e283ca..fa30f2e 100644
--- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js
@@ -29,6 +29,7 @@ test('Basic creation test', function(assert) {
assert.ok(route);
assert.ok(route.title);
assert.ok(route.setupController);
+ assert.ok(route.load);
});
test('setupController test', function(assert) {
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js
index e55e184..fb27c80 100644
--- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js
@@ -29,6 +29,7 @@ test('Basic creation test', function(assert) {
assert.ok(route);
assert.ok(route.title);
assert.ok(route.setupController);
+ assert.ok(route.load);
});
test('setupController test', function(assert) {
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/serializers/attempt-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/attempt-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/attempt-test.js
new file mode 100644
index 0000000..452b8af
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/serializers/attempt-test.js
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('serializer:attempt', 'Unit | Serializer | attempt', {
+ // Specify the other units that are required for this test.
+ // needs: ['serializer:attempt']
+});
+
+// Replace this with your real tests.
+test('Basic creation test', function(assert) {
+ let serializer = this.subject();
+
+ assert.ok(serializer);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js
index 7dd635c..eb39508 100644
--- a/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/serializers/dag-test.js
@@ -31,6 +31,7 @@ test('Basic creation test', function(assert) {
assert.ok(serializer.maps.startTime);
assert.ok(serializer.maps.endTime);
assert.ok(serializer.maps.containerLogs);
+ assert.ok(serializer.maps.vertexIdNameMap);
});
test('atsStatus test', function(assert) {
@@ -107,3 +108,24 @@ test('containerLogs test', function(assert) {
otherinfo: {inProgressLogsURL_1: "foo", inProgressLogsURL_2: "bar"},
}), [{text: "1", href: "http://foo"}, {text: "2", href: "http://bar"}], "2 logs");
});
+
+test('vertexIdNameMap test', function(assert) {
+ let serializer = this.subject(),
+ mapper = serializer.maps.vertexIdNameMap;
+
+ let nameIdMap = {
+ otherinfo: {
+ vertexNameIdMapping: {
+ name1: "ID1",
+ name2: "ID2",
+ name3: "ID3",
+ }
+ }
+ };
+
+ assert.deepEqual(mapper(nameIdMap), {
+ ID1: "name1",
+ ID2: "name2",
+ ID3: "name3",
+ });
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/serializers/task-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/task-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/task-test.js
new file mode 100644
index 0000000..fc79ae9
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/serializers/task-test.js
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('serializer:task', 'Unit | Serializer | task', {
+ // Specify the other units that are required for this test.
+ // needs: ['serializer:task']
+});
+
+test('Basic creation test', function(assert) {
+ let serializer = this.subject();
+
+ assert.ok(serializer);
+ assert.ok(serializer.maps);
+});
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js
index 53f0b06..3c267ad 100644
--- a/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js
@@ -28,6 +28,7 @@ test('Basic creation test', function(assert) {
assert.ok(serializer);
assert.ok(serializer.extractArrayPayload);
+ assert.ok(serializer.maps);
});
test('extractArrayPayload test', function(assert) {
http://git-wip-us.apache.org/repos/asf/tez/blob/a1c3622a/tez-ui2/src/main/webapp/tests/unit/serializers/vertex-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/vertex-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/vertex-test.js
new file mode 100644
index 0000000..7dfb5da
--- /dev/null
+++ b/tez-ui2/src/main/webapp/tests/unit/serializers/vertex-test.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('serializer:vertex', 'Unit | Serializer | vertex', {
+ // Specify the other units that are required for this test.
+ // needs: ['serializer:vertex']
+});
+
+test('Basic creation test', function(assert) {
+ let serializer = this.subject();
+
+ assert.ok(serializer);
+ assert.ok(serializer.maps);
+ assert.ok(serializer.maps.processorClassName);
+});
+
+test('processorClassName test', function(assert) {
+ let serializer = this.subject(),
+ processorClassName = serializer.maps.processorClassName;
+
+ assert.equal(processorClassName({}), "");
+ assert.equal(processorClassName({
+ otherinfo: {
+ processorClassName: "foo"
+ }
+ }), "foo");
+ assert.equal(processorClassName({
+ otherinfo: {
+ processorClassName: "a.b.foo"
+ }
+ }), "foo");
+});