AMBARI-20416. Need some way to know a plan is vectorized (pallavkul)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/87e82c7c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/87e82c7c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/87e82c7c Branch: refs/heads/branch-feature-AMBARI-12556 Commit: 87e82c7c0dfa2c26560a1bdbc743b360eb787a3a Parents: c3b5615 Author: pallavkul <pallav....@gmail.com> Authored: Tue Mar 14 17:16:14 2017 +0530 Committer: pallavkul <pallav....@gmail.com> Committed: Tue Mar 14 17:16:14 2017 +0530 ---------------------------------------------------------------------- .../main/resources/ui/app/components/visual-explain.js | 10 +++++++++- .../hive20/src/main/resources/ui/app/routes/databases.js | 4 +++- .../resources/ui/app/routes/databases/database/tables.js | 4 +++- .../ui/app/templates/components/visual-explain-detail.hbs | 3 +++ .../ui/app/templates/components/visual-explain.hbs | 2 +- .../resources/ui/app/utils/hive-explainer/renderer.js | 5 ++++- .../resources/ui/app/utils/hive-explainer/transformer.js | 1 + 7 files changed, 24 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js index fd450cc..10ff616 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js @@ -29,6 +29,8 @@ export default Ember.Component.extend({ explainDetailData: '', + vectorizedInfo: null, + draggable: Ember.Object.create(), visualExplainInput: Ember.computed('visualExplainJson', function () { @@ -39,8 +41,13 @@ export default Ember.Component.extend({ didInsertElement() { this._super(...arguments); - const onRequestDetail = data => this.set('explainDetailData', JSON.stringify( data, null, ' ') ); const explainData = JSON.parse(this.get('visualExplainInput')); + const onRequestDetail = (data, vectorized) => { + this.set('explainDetailData', JSON.stringify( data, null, ' ') ); + console.log('vectorizedInfo', vectorized['Execution mode:']); + this.set('vectorizedInfo', vectorized['Execution mode:']); + }; + // if(explainData) { explain(explainData, '#explain-container', onRequestDetail, this.get('draggable')); // } @@ -68,6 +75,7 @@ export default Ember.Component.extend({ closeModal(){ this.set('showDetailsModal', false); this.set('explainDetailData', ''); + this.set('vectorizedInfo', ''); return false; } http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js index 02dbcac..185be01 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases.js @@ -34,7 +34,9 @@ export default Ember.Route.extend(UILoggerMixin, { }, deactivate() { - this.get('autoRefresh').stopDatabasesAutoRefresh(); + if(ENV.APP.SHOULD_AUTO_REFRESH_DATABASES) { + this.get('autoRefresh').stopDatabasesAutoRefresh(); + } }, _databasesRefreshed() { http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js index f5940e3..0e9042e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables.js @@ -32,7 +32,9 @@ export default Ember.Route.extend(UILoggerMixin, { }, deactivate() { - this.get('autoRefresh').stopTablesAutoRefresh(this.controller.get('database.name')); + if(ENV.APP.SHOULD_AUTO_REFRESH_TABLES) { + this.get('autoRefresh').stopTablesAutoRefresh(this.controller.get('database.name')); + } }, tableRefreshStarting(databaseName) { http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs index 3df8e94..12a0897 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain-detail.hbs @@ -22,6 +22,9 @@ </div> <div class="col-md-12"> <div> </div> + {{#if vectorizedInfo}} + <div class="vector-info">{{vectorizedInfo}}</div> + {{/if}} <pre class="prettyprint">{{explainDetailData}}</pre> </div> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs index 30f9405..2edeab2 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/visual-explain.hbs @@ -34,7 +34,7 @@ {{/unless}} {{#if showDetailsModal}} - {{visual-explain-detail closeModal='closeModal' explainDetailData=explainDetailData}} + {{visual-explain-detail closeModal='closeModal' explainDetailData=explainDetailData vectorizedInfo=vectorizedInfo}} {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index b36d7b4..1cfcb15 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -132,7 +132,10 @@ function recurseC(children, onRequestDetail) { .append('xhtml:body') .style('margin', 0) .html(d => getRenderer(d._operator)(d)) - .on('click', d => onRequestDetail(doClean(d))); + .on('click', d => { + const vertex = d3.select(Ember.$(d3.select(this).node()).closest('.vertex').get(0)).data()[0]; + onRequestDetail(doClean(d), vertex); + }); children .call(recurseC, onRequestDetail); http://git-wip-us.apache.org/repos/asf/ambari/blob/87e82c7c/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js index d88de98..ac592ec 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js @@ -206,6 +206,7 @@ function getTezVertices(plan) { return Object.assign({}, doCloneAndOmit(cVertex, VERTEX_TREE_KEYS), { _vertex: cVertexKey, + _execution: vertexObj['Execution mode:'] || 'Unavailable', _children: children, }); });