Repository: tez Updated Branches: refs/heads/master bd9b8d951 -> f719c7bc5
TEZ-2275. Tez UI: enable faster loading and caching of data in tables (Sreenath Somarajapuram via pramachandran) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/f719c7bc Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/f719c7bc Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/f719c7bc Branch: refs/heads/master Commit: f719c7bc5c7750457884252858f25f1b5cd2d71b Parents: bd9b8d9 Author: Prakash Ramachandran <[email protected]> Authored: Mon Apr 13 14:21:54 2015 +0530 Committer: Prakash Ramachandran <[email protected]> Committed: Mon Apr 13 14:21:54 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../app/scripts/components/counter-table.js | 8 +- .../controllers/dag-task-attempts-controller.js | 4 +- .../webapp/app/scripts/controllers/dag_tasks.js | 4 +- .../app/scripts/controllers/dag_vertices.js | 4 +- .../task_task_attempts_controller.js | 4 +- .../vertex_task_attempts_controller.js | 4 +- .../controllers/vertex_tasks_controller.js | 4 +- .../src/main/webapp/app/scripts/helpers/misc.js | 20 ++ .../scripts/mixins/data-array-loader-minxin.js | 12 +- .../app/scripts/models/TimelineRestAdapter.js | 182 ++++--------------- .../src/main/webapp/app/scripts/models/dag.js | 13 +- .../webapp/app/scripts/models/task_attempt.js | 9 +- .../app/templates/components/counter-table.hbs | 6 +- .../webapp/app/templates/vertex/additionals.hbs | 18 +- 15 files changed, 118 insertions(+), 175 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index e12edaa..882f1f9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,7 @@ INCOMPATIBLE CHANGES TEZ-1993. Implement a pluggable InputSizeEstimator for grouping fairly ALL CHANGES: + TEZ-2275. Tez UI: enable faster loading and caching of data in tables TEZ-2234. Add API for statistics information - allow vertex managers to get output size per source vertex TEZ-2274. Tez UI: full data loading, client side search and sort for other pages http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/components/counter-table.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/components/counter-table.js b/tez-ui/src/main/webapp/app/scripts/components/counter-table.js index 781df32..94615c3 100644 --- a/tez-ui/src/main/webapp/app/scripts/components/counter-table.js +++ b/tez-ui/src/main/webapp/app/scripts/components/counter-table.js @@ -30,14 +30,14 @@ App.CounterTableComponent = Em.Component.extend({ rawData.forEach(function(cg) { var tmpcg = { - name: cg.get('name'), - displayName: cg.get('displayName'), + counterGroupName: cg['counterGroupName'], + counterGroupDisplayName: cg['counterGroupDisplayName'], counters: [] }; - var counters = cg.get('counters') || []; + var counters = cg['counters'] || []; counters.forEach(function(counter) { - if (filterStringRegex.test(counter.get('displayName'))) { + if (filterStringRegex.test(counter['counterDisplayName'])) { tmpcg.counters.push(counter); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js index 2dda5f4..3b667d8 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js @@ -21,10 +21,12 @@ App.DagTaskAttemptsController = App.TablePageController.extend({ controllerName: 'DagTaskAttemptsController', needs: "dag", - entityType: 'taskAttempt', + entityType: 'dagTaskAttempt', filterEntityType: 'dag', filterEntityId: Ember.computed.alias('controllers.dag.id'), + cacheDomain: Ember.computed.alias('controllers.dag.id'), + beforeLoad: function () { var dagController = this.get('controllers.dag'), model = dagController.get('model'); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js index 56a499a..598fa3f 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js @@ -21,10 +21,12 @@ App.DagTasksController = App.TablePageController.extend({ controllerName: 'DagTasksController', needs: "dag", - entityType: 'task', + entityType: 'dagTask', filterEntityType: 'dag', filterEntityId: Ember.computed.alias('controllers.dag.id'), + cacheDomain: Ember.computed.alias('controllers.dag.id'), + beforeLoad: function () { var dagController = this.get('controllers.dag'), model = dagController.get('model'); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js index eec502b..4e5531a 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_vertices.js @@ -20,10 +20,12 @@ App.DagVerticesController = App.TablePageController.extend({ controllerName: 'DagVerticesController', needs: "dag", - entityType: 'vertex', + entityType: 'dagVertex', filterEntityType: 'dag', filterEntityId: Ember.computed.alias('controllers.dag.id'), + cacheDomain: Ember.computed.alias('controllers.dag.id'), + beforeLoad: function () { var dagController = this.get('controllers.dag'), model = dagController.get('model'); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js index 06e311f..8859ac4 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js @@ -21,10 +21,12 @@ App.TaskAttemptsController = App.TablePageController.extend({ controllerName: 'TaskAttemptsController', needs: "task", - entityType: 'taskAttempt', + entityType: 'taskTaskAttempt', filterEntityType: 'task', filterEntityId: Ember.computed.alias('controllers.task.id'), + cacheDomain: Ember.computed.alias('controllers.task.dagID'), + beforeLoad: function () { var taskController = this.get('controllers.task'), model = taskController.get('model'); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js index 1bebd53..ada4bdc 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js @@ -21,10 +21,12 @@ App.VertexTaskAttemptsController = App.TablePageController.extend({ controllerName: 'VertexTaskAttemptsController', needs: "vertex", - entityType: 'taskAttempt', + entityType: 'vertexTaskAttempt', filterEntityType: 'vertex', filterEntityId: Ember.computed.alias('controllers.vertex.id'), + cacheDomain: Ember.computed.alias('controllers.vertex.dagID'), + beforeLoad: function () { var controller = this.get('controllers.vertex'), model = controller.get('model'); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js index 8b815b0..08c1a87 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js @@ -21,10 +21,12 @@ App.VertexTasksController = App.TablePageController.extend({ controllerName: 'VertexTasksController', needs: "vertex", - entityType: 'task', + entityType: 'vertexTask', filterEntityType: 'vertex', filterEntityId: Ember.computed.alias('controllers.vertex.id'), + cacheDomain: Ember.computed.alias('controllers.vertex.dagID'), + beforeLoad: function () { var controller = this.get('controllers.vertex'), model = controller.get('model'); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/helpers/misc.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js index 27275dd..53149a4 100644 --- a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js +++ b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js @@ -412,9 +412,19 @@ App.Helpers.misc = { timelinePathForType: (function () { var typeToPathMap = { dag: 'TEZ_DAG_ID', + vertex: 'TEZ_VERTEX_ID', + dagVertex: 'TEZ_VERTEX_ID', + task: 'TEZ_TASK_ID', + dagTask: 'TEZ_TASK_ID', + vertexTask: 'TEZ_TASK_ID', + taskAttempt: 'TEZ_TASK_ATTEMPT_ID', + dagTaskAttempt: 'TEZ_TASK_ATTEMPT_ID', + vertexTaskAttempt: 'TEZ_TASK_ATTEMPT_ID', + taskTaskAttempt: 'TEZ_TASK_ATTEMPT_ID', + tezApp: 'TEZ_APPLICATION' }; return function (type) { @@ -425,9 +435,19 @@ App.Helpers.misc = { getTimelineFilterForType: (function () { var typeToPathMap = { dag: 'TEZ_DAG_ID', + vertex: 'TEZ_VERTEX_ID', + dagVertex: 'TEZ_VERTEX_ID', + task: 'TEZ_TASK_ID', + dagTask: 'TEZ_TASK_ID', + vertexTask: 'TEZ_TASK_ID', + taskAttempt: 'TEZ_TASK_ATTEMPT_ID', + dagTaskAttempt: 'TEZ_TASK_ATTEMPT_ID', + vertexTaskAttempt: 'TEZ_TASK_ATTEMPT_ID', + taskTaskAttempt: 'TEZ_TASK_ATTEMPT_ID', + tezApp: 'applicationId' }; return function (type) { http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js b/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js index 977143c..e5dbbf9 100644 --- a/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js +++ b/tez-ui/src/main/webapp/app/scripts/mixins/data-array-loader-minxin.js @@ -26,6 +26,9 @@ App.DataArrayLoaderMixin = Em.Mixin.create({ filterEntityType: null, filterEntityId: null, + // At a time for an entity type, records under one single domain value will only be cached. + cacheDomain: undefined, + isRefreshable: true, _cacheKey: function () { @@ -86,9 +89,14 @@ App.DataArrayLoaderMixin = Em.Mixin.create({ load: function (filter) { var entityType = this.get('entityType'), store = this.get('store'), - data = dataCache[this.get('_cacheKey')]; + data = dataCache[this.get('_cacheKey')], + domainKey = entityType + ":Domain"; - if(data) { + if(this.get('cacheDomain') != dataCache[domainKey]) { + store.unloadAll(entityType); + dataCache[domainKey] = this.get('cacheDomain'); + } + else if(data) { data.toArray().forEach(function (record) { record.unloadRecord(); }); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js index e14a724..a54ded2 100644 --- a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js +++ b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js @@ -15,14 +15,6 @@ * the License. */ -var typeToPathMap = { - dag: 'TEZ_DAG_ID', - vertex: 'TEZ_VERTEX_ID', - task: 'TEZ_TASK_ID', - taskAttempt: 'TEZ_TASK_ATTEMPT_ID', - tezApp: 'TEZ_APPLICATION' -}; - App.TimelineRESTAdapter = DS.RESTAdapter.extend({ ajax: function(url, method, hash) { hash = hash || {}; // hash may be undefined @@ -32,9 +24,7 @@ App.TimelineRESTAdapter = DS.RESTAdapter.extend({ return this._super(url, method, hash); }, namespace: App.Configs.restNamespace.timeline, - pathForType: function(type) { - return typeToPathMap[type]; - } + pathForType: App.Helpers.misc.timelinePathForType }); App.TimelineSerializer = DS.RESTSerializer.extend({ @@ -107,11 +97,14 @@ var timelineJsonToDagMap = { status: 'otherinfo.status', diagnostics: 'otherinfo.diagnostics', + counterGroups: 'otherinfo.counters.counterGroups', + planName: 'otherinfo.dagPlan.dagName', planVersion: 'otherinfo.dagPlan.version', vertices: 'otherinfo.dagPlan.vertices', edges: 'otherinfo.dagPlan.edges', vertexGroups: 'otherinfo.dagPlan.vertexGroups', + vertexIdToNameMap: { custom: function(source) { var nameToIdMap = Em.get(source, 'otherinfo.vertexNameIdMapping') || {}; @@ -122,49 +115,9 @@ var timelineJsonToDagMap = { return idToNameMap; } }, - - counterGroups: 'counterGroups' }; App.DagSerializer = App.TimelineSerializer.extend({ - _normalizeSingleDagPayload: function(dag) { - var normalizedCounterGroupData = this.normalizeCounterGroupsHelper('dag', dag.entity, - dag); - dag.counterGroups = normalizedCounterGroupData.counterGroupsIDs; - delete dag.otherinfo.counters; - - return { - dag: dag, - counterGroups: normalizedCounterGroupData.counterGroups, - counters: normalizedCounterGroupData.counters - }; - }, - - normalizePayload: function(rawPayload){ - - if (!!rawPayload.dags) { - // multiple dags - cames here through _findAll/_findQuery - var normalizedPayload = { - dags: [], - counterGroups: [], - counters: [] - }; - rawPayload.dags.forEach(function(dag){ - var n = this._normalizeSingleDagPayload(dag); - normalizedPayload.dags.push(n.dag); - [].push.apply(normalizedPayload.counterGroups, n.counterGroups); - [].push.apply(normalizedPayload.counters, n.counters); - }, this); - - // delete so that we dont hang on to the json data. - delete rawPayload.dags; - - return normalizedPayload; - } else { - return this._normalizeSingleDagPayload(rawPayload.dag); - } - }, - normalize: function(type, hash, prop) { return Em.JsonMapper.map(hash, timelineJsonToDagMap); }, @@ -176,7 +129,7 @@ var timelineJsonToTaskAttemptMap = { endTime: 'otherinfo.endTime', status: 'otherinfo.status', diagnostics: 'otherinfo.diagnostics', - counterGroups: 'counterGroups', + counterGroups: 'otherinfo.counters.counterGroups', inProgressLog: 'otherinfo.inProgressLogsURL', completedLog: 'otherinfo.completedLogsURL', @@ -189,41 +142,10 @@ var timelineJsonToTaskAttemptMap = { diagnostics: 'otherinfo.diagnostics' }; +App.DagTaskAttemptSerializer = +App.VertexTaskAttemptSerializer = +App.TaskTaskAttemptSerializer = App.TaskAttemptSerializer = App.TimelineSerializer.extend({ - _normalizeSingleTaskAttemptPayload: function(taskAttempt) { - var normalizedCounterGroupData = this.normalizeCounterGroupsHelper('taskAttempt', - taskAttempt.entity, taskAttempt); - taskAttempt.counterGroups = normalizedCounterGroupData.counterGroupsIDs; - delete taskAttempt.otherinfo.counters; - - return {taskAttempt: taskAttempt, counterGroups: normalizedCounterGroupData.counterGroups, - counters: normalizedCounterGroupData.counters - }; - }, - - normalizePayload: function(rawPayload){ - - if (!!rawPayload.taskAttempts) { - var normalizedPayload = { - taskAttempts: [], - counterGroups: [], - counters: [] - }; - rawPayload.taskAttempts.forEach(function(taskAttempt){ - var n = this._normalizeSingleTaskAttemptPayload(taskAttempt); - normalizedPayload.taskAttempts.push(n.taskAttempt); - [].push.apply(normalizedPayload.counterGroups, n.counterGroups); - [].push.apply(normalizedPayload.counters, n.counters); - }, this); - - // delete so that we dont hang on to the json data. - delete rawPayload.taskAttempts; - return normalizedPayload; - } else { - return this._normalizeSingleTaskAttemptPayload(rawPayload.taskAttempt); - } - }, - normalize: function(type, hash, prop) { return Em.JsonMapper.map(hash, timelineJsonToTaskAttemptMap); }, @@ -237,50 +159,15 @@ var timelineJsonToTaskMap = { endTime: 'otherinfo.endTime', status: 'otherinfo.status', diagnostics: 'otherinfo.diagnostics', - counterGroups: 'counterGroups', + counterGroups: 'otherinfo.counters.counterGroups', successfulAttemptId: 'otherinfo.successfulAttemptId', attempts: 'relatedentities.TEZ_TASK_ATTEMPT_ID', numAttempts: 'relatedentities.TEZ_TASK_ATTEMPT_ID.length' }; +App.DagTaskSerializer = +App.VertexTaskSerializer = App.TaskSerializer = App.TimelineSerializer.extend({ - _normalizeSingleTaskPayload: function(task) { - var normalizedCounterGroupData = this.normalizeCounterGroupsHelper('task', task.entity, - task); - task.counterGroups = normalizedCounterGroupData.counterGroupsIDs; - - delete task.otherinfo.counters; - - return { - task: task, - counterGroups: normalizedCounterGroupData.counterGroups, - counters: normalizedCounterGroupData.counters - }; - }, - - normalizePayload: function(rawPayload) { - if (!!rawPayload.tasks) { - var normalizedPayload = { - tasks: [], - counterGroups: [], - counters: [] - }; - rawPayload.tasks.forEach(function(task){ - var n = this._normalizeSingleTaskPayload(task); - normalizedPayload.tasks.push(n.task); - [].push.apply(normalizedPayload.counterGroups, n.counterGroups); - [].push.apply(normalizedPayload.counters, n.counters); - }, this); - - // delete so that we dont hang on to the json data. - delete rawPayload.tasks; - - return normalizedPayload; - } else { - return this._normalizeSingleTaskPayload(rawPayload.task); - } - }, - normalize: function(type, hash, prop) { return Em.JsonMapper.map(hash, timelineJsonToTaskMap); }, @@ -292,7 +179,7 @@ var timelineJsonToVertexMap = { dagID: 'primaryfilters.TEZ_DAG_ID.0', applicationId: 'primaryfilters.applicationId.0', processorClassName: 'processorClassName', - counterGroups: 'counterGroups', + counterGroups: 'otherinfo.counters.counterGroups', inputs: 'inputs', outputs: 'outputs', @@ -323,18 +210,13 @@ var timelineJsonToVertexMap = { App.VertexSerializer = App.TimelineSerializer.extend({ _normalizeSingleVertexPayload: function(vertex) { - var normalizedCounterGroupData = this.normalizeCounterGroupsHelper('vertex', vertex.entity, - vertex), processorClassName = Ember.get(vertex, 'otherinfo.processorClassName') || "", inputs = [], inputIds = [], outputs = [], outputIds = []; - vertex.processorClassName = processorClassName.substr(processorClassName.lastIndexOf('.') + 1), - vertex.counterGroups = normalizedCounterGroupData.counterGroupsIDs; - - delete vertex.otherinfo.counters; + vertex.processorClassName = processorClassName.substr(processorClassName.lastIndexOf('.') + 1); if(vertex.inputs) { vertex.inputs.forEach(function (input, index) { @@ -356,37 +238,39 @@ App.VertexSerializer = App.TimelineSerializer.extend({ return { vertex: vertex, - counterGroups: normalizedCounterGroupData.counterGroups, inputs: inputs, - outputs: outputs, - counters: normalizedCounterGroupData.counters + outputs: outputs }; }, - normalizePayload: function(rawPayload) { - if (!!rawPayload.vertices) { + normalizePayload: function(rawPayload, property) { + var pluralizedPoperty, + n; + + property = property || 'vertex', + pluralizedPoperty = property.pluralize();; + if (!!rawPayload[pluralizedPoperty]) { var normalizedPayload = { - vertices: [], - counterGroups: [], inputs: [], outputs: [], - counters: [] }; - rawPayload.vertices.forEach(function(vertex){ - var n = this._normalizeSingleVertexPayload(vertex); - normalizedPayload.vertices.push(n.vertex); - [].push.apply(normalizedPayload.counterGroups, n.counterGroups); - [].push.apply(normalizedPayload.counters, n.counters); + normalizedPayload[pluralizedPoperty] = []; + + rawPayload[pluralizedPoperty].forEach(function(vertex){ + n = this._normalizeSingleVertexPayload(vertex); + normalizedPayload[pluralizedPoperty].push(n.vertex); [].push.apply(normalizedPayload.inputs, n.inputs); [].push.apply(normalizedPayload.outputs, n.outputs); }, this); // delete so that we dont hang on to the json data. - delete rawPayload.vertices; + delete rawPayload[pluralizedPoperty]; return normalizedPayload; } else { - return this._normalizeSingleVertexPayload(rawPayload.vertex); + n = {}; + n[property] = this._normalizeSingleVertexPayload(rawPayload[property]).vertex; + return n; } }, @@ -395,6 +279,12 @@ App.VertexSerializer = App.TimelineSerializer.extend({ }, }); +App.DagVertexSerializer = App.VertexSerializer.extend({ + normalizePayload: function (rawPayload) { + return this._super(rawPayload, 'dagVertex'); + } +}); + App.InputSerializer = App.TimelineSerializer.extend({ _map: { id: 'entity', http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/models/dag.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/models/dag.js b/tez-ui/src/main/webapp/app/scripts/models/dag.js index 05e356b..9053078 100644 --- a/tez-ui/src/main/webapp/app/scripts/models/dag.js +++ b/tez-ui/src/main/webapp/app/scripts/models/dag.js @@ -29,6 +29,10 @@ App.Dag = App.AbstractEntity.extend({ // end time of the entity endTime: DS.attr('number'), + duration: function () { + return App.Helpers.date.duration(this.get('startTime'), this.get('endTime')) + }.property('startTime', 'endTime'), + // set type to DAG entityType: App.EntityType.DAG, @@ -58,7 +62,7 @@ App.Dag = App.AbstractEntity.extend({ vertexGroups: DS.attr('array'), vertexIdToNameMap: DS.attr('array'), - counterGroups: DS.hasMany('counterGroup', { inverse: 'parent' }) + counterGroups: DS.attr('array'), }); App.CounterGroup = DS.Model.extend({ @@ -194,7 +198,7 @@ App.Vertex = App.AbstractEntity.extend({ diagnostics: DS.attr('string'), - counterGroups: DS.hasMany('counterGroup'), + counterGroups: DS.attr('array'), tasksNumber: function () { return this.getWithDefault('tasksCount', 0); @@ -257,6 +261,7 @@ App.Vertex = App.AbstractEntity.extend({ return App.Helpers.date.timingFormat(this.get('duration'), true); }.property('duration') }); +App.DagVertex = App.Vertex.extend({}); App.Input = App.AbstractEntity.extend({ entity: DS.attr('string'), @@ -343,8 +348,10 @@ App.Task = App.AbstractEntity.extend({ pivotAttempt: DS.belongsTo('taskAttempt'), - counterGroups: DS.hasMany('counterGroup', { inverse: 'parent' }) + counterGroups: DS.attr('array'), // Serialize when required }); +App.DagTask = App.Task.extend({}); +App.VertexTask = App.Task.extend({}); App.DagProgress = DS.Model.extend({ progress: DS.attr('number'), http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js b/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js index d3d01ad..d8a48e6 100644 --- a/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js +++ b/tez-ui/src/main/webapp/app/scripts/models/task_attempt.js @@ -28,6 +28,10 @@ App.TaskAttempt = App.AbstractEntity.extend({ // end time of the entity endTime: DS.attr('number'), + duration: function () { + return App.Helpers.date.duration(this.get('startTime'), this.get('endTime')) + }.property('startTime', 'endTime'), + entityType: App.EntityType.TASK_ATTEMPT, // container @@ -47,5 +51,8 @@ App.TaskAttempt = App.AbstractEntity.extend({ diagnostics: DS.attr('string'), - counterGroups: DS.hasMany('counterGroup', { inverse: 'parent' }) + counterGroups: DS.attr('array'), }); +App.DagTaskAttempt = App.TaskAttempt.extend({}); +App.VertexTaskAttempt = App.TaskAttempt.extend({}); +App.TaskTaskAttempt = App.TaskAttempt.extend({}); http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs b/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs index e9070f1..6da06f0 100644 --- a/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs +++ b/tez-ui/src/main/webapp/app/templates/components/counter-table.hbs @@ -29,12 +29,12 @@ <tbody> {{#each counterGroup in filteredData}} <tr class='group-header'> - <td colspan='2'>{{counterGroup.displayName}}</td> + <td colspan='2'>{{counterGroup.counterGroupDisplayName}}</td> </tr> {{#each counter in counterGroup.counters}} <tr> - <td>{{counter.displayName}}</td> - <td>{{formatNumThousands counter.value}}</td> + <td>{{counter.counterDisplayName}}</td> + <td>{{formatNumThousands counter.counterValue}}</td> </tr> {{/each}} {{/each}} http://git-wip-us.apache.org/repos/asf/tez/blob/f719c7bc/tez-ui/src/main/webapp/app/templates/vertex/additionals.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/vertex/additionals.hbs b/tez-ui/src/main/webapp/app/templates/vertex/additionals.hbs index f6ee573..a3da8e0 100644 --- a/tez-ui/src/main/webapp/app/templates/vertex/additionals.hbs +++ b/tez-ui/src/main/webapp/app/templates/vertex/additionals.hbs @@ -26,11 +26,10 @@ {{#unless loading}} <h3>Sources</h3> {{#if inputsAvailable}} - {{extended-table-component - hasFooter=false - columnsBinding="inputColumns" - contentBinding="inputContent" - forceFillColumns=true + {{basic-table-component + columns=inputColumns + rows=inputContent + enableSort=true }} {{else}} <h4>Not available!</h4> @@ -38,11 +37,10 @@ <h3>Sinks</h3> {{#if outputsAvailable}} - {{extended-table-component - hasFooter=false - columnsBinding="outputColumns" - contentBinding="outputContent" - forceFillColumns=true + {{basic-table-component + columns=outputColumns + rows=outputContent + enableSort=true }} {{else}} <h4>Not available!</h4>
