Repository: ambari Updated Branches: refs/heads/branch-2.4 cba55ba2f -> 0942cc0bb
AMBARI-17264. Ranger Tagsync shows under Summary Tab after upgrade from 2.4 to 2.5 (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0942cc0b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0942cc0b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0942cc0b Branch: refs/heads/branch-2.4 Commit: 0942cc0bbf362a86e62a503537694c1ebb02918e Parents: cba55ba Author: Aleksandr Kovalenko <[email protected]> Authored: Thu Jun 16 13:37:43 2016 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Thu Jun 16 13:38:55 2016 +0300 ---------------------------------------------------------------------- ambari-web/app/models/service/ranger.js | 6 +-- .../templates/main/service/services/hbase.hbs | 38 ++++++++++--------- .../templates/main/service/services/hdfs.hbs | 38 ++++++++++--------- .../templates/main/service/services/ranger.hbs | 2 +- .../templates/main/service/services/storm.hbs | 39 ++++++++++---------- .../templates/main/service/services/yarn.hbs | 34 +++++++++-------- ambari-web/app/views/main/service/service.js | 14 ++++++- .../app/views/main/service/services/hbase.js | 12 ++++-- .../app/views/main/service/services/hdfs.js | 13 +++++-- .../app/views/main/service/services/ranger.js | 10 ++--- .../app/views/main/service/services/storm.js | 6 ++- .../app/views/main/service/services/yarn.js | 6 ++- .../views/main/service/services/hdfs_test.js | 4 +- .../views/main/service/services/ranger_test.js | 23 ------------ 14 files changed, 127 insertions(+), 118 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/models/service/ranger.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/ranger.js b/ambari-web/app/models/service/ranger.js index b6f99e1..9004d50 100644 --- a/ambari-web/app/models/service/ranger.js +++ b/ambari-web/app/models/service/ranger.js @@ -18,9 +18,9 @@ var App = require('app'); App.RangerService = App.Service.extend({ - rangerTagsyncsStarted: DS.attr('number'), - rangerTagsyncsInstalled: DS.attr('number'), - rangerTagsyncsTotal: DS.attr('number') + rangerTagsyncsStarted: DS.attr('number', {defaultValue: 0}), + rangerTagsyncsInstalled: DS.attr('number', {defaultValue: 0}), + rangerTagsyncsTotal: DS.attr('number', {defaultValue: 0}) }); App.RangerService.FIXTURES = []; http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/templates/main/service/services/hbase.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/hbase.hbs b/ambari-web/app/templates/main/service/services/hbase.hbs index 68e0224..d575127 100644 --- a/ambari-web/app/templates/main/service/services/hbase.hbs +++ b/ambari-web/app/templates/main/service/services/hbase.hbs @@ -19,25 +19,27 @@ <!-- HBase Master Server --> {{view view.dashboardMasterComponentView}} <!-- RegionServers --> -<tr {{bindAttr class=":component view.regionServerComponent.componentName"}}> - <td class="summary-label"><a - href="#" {{action filterHosts view.regionServerComponent}}>{{t dashboard.services.hbase.regionServers}}</a> - </td> - <td class="summary-value"> - {{#if App.router.clusterController.isServiceContentFullyLoaded}} - <span> - {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.regionServersStarted" totalComponentsBinding="view.service.regionServersTotal"}} - {{view.liveComponents}}/{{view.totalComponents}} - {{/view}} - </span> - {{t services.service.summary.RegionServersLIVE}} - {{else}} - {{t common.loading.eclipses}} - {{/if}} - </td> -</tr> +{{#if view.isRegionServerCreated}} + <tr {{bindAttr class=":component view.regionServerComponent.componentName"}}> + <td class="summary-label"><a + href="#" {{action filterHosts view.regionServerComponent}}>{{t dashboard.services.hbase.regionServers}}</a> + </td> + <td class="summary-value"> + {{#if App.router.clusterController.isServiceContentFullyLoaded}} + <span> + {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.regionServersStarted" totalComponentsBinding="view.service.regionServersTotal"}} + {{view.liveComponents}}/{{view.totalComponents}} + {{/view}} + </span> + {{t services.service.summary.RegionServersLIVE}} + {{else}} + {{t common.loading.eclipses}} + {{/if}} + </td> + </tr> +{{/if}} <!-- PhoenixServers --> -{{#if view.showPhoenixInfo}} +{{#if view.isPhoenixQueryServerCreated}} <tr {{bindAttr class=":component view.phoenixServerComponent.componentName"}}> <td class="summary-label"><a href="#" {{action filterHosts view.phoenixServerComponent}}>{{t dashboard.services.hbase.phoenixServers}}</a> http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/templates/main/service/services/hdfs.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/hdfs.hbs b/ambari-web/app/templates/main/service/services/hdfs.hbs index 4f1f820..cc64a2f 100644 --- a/ambari-web/app/templates/main/service/services/hdfs.hbs +++ b/ambari-web/app/templates/main/service/services/hdfs.hbs @@ -18,23 +18,25 @@ {{view view.dashboardMasterComponentView}} <!-- Data Nodes --> -<tr {{bindAttr class=":component view.dataNodeComponent.componentName"}}> - <td class="summary-label"><a - href="#" {{action filterHosts view.dataNodeComponent}}>{{t dashboard.services.hdfs.datanodes}}</a> - </td> - <td class="summary-value"> - {{#if App.router.clusterController.isServiceContentFullyLoaded}} - <span> - {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.dataNodesStarted" totalComponentsBinding="view.service.dataNodesTotal"}} - {{view.liveComponents}}/{{view.totalComponents}} - {{/view}} - </span> - {{t common.started}} - {{else}} - {{t common.loading.eclipses}} - {{/if}} - </td> -</tr> +{{#if view.isDataNodeCreated}} + <tr {{bindAttr class=":component view.dataNodeComponent.componentName"}}> + <td class="summary-label"><a + href="#" {{action filterHosts view.dataNodeComponent}}>{{t dashboard.services.hdfs.datanodes}}</a> + </td> + <td class="summary-value"> + {{#if App.router.clusterController.isServiceContentFullyLoaded}} + <span> + {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.dataNodesStarted" totalComponentsBinding="view.service.dataNodesTotal"}} + {{view.liveComponents}}/{{view.totalComponents}} + {{/view}} + </span> + {{t common.started}} + {{else}} + {{t common.loading.eclipses}} + {{/if}} + </td> + </tr> +{{/if}} <!-- Data Node Counts --> <tr class="datanode-count"> <td class="summary-label">{{t dashboard.services.hdfs.datanodecounts}}</td> @@ -52,7 +54,7 @@ {{/if}} </tr> <!-- JournalNodes --> -{{#if view.showJournalNodes}} +{{#if view.isJournalNodeCreated}} <tr {{bindAttr class=":component view.journalNodeComponent.componentName"}}> <td class="summary-label"> <a href="#" {{action filterHosts view.journalNodeComponent}}>{{t dashboard.services.hdfs.journalnodes}}</a> http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/templates/main/service/services/ranger.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/ranger.hbs b/ambari-web/app/templates/main/service/services/ranger.hbs index fb99453..07027f4 100644 --- a/ambari-web/app/templates/main/service/services/ranger.hbs +++ b/ambari-web/app/templates/main/service/services/ranger.hbs @@ -19,7 +19,7 @@ {{view view.dashboardMasterComponentView}} <!-- Ranger Tagsyncs --> -{{#if view.isRangerTagsyncInStack}} +{{#if view.isRangerTagsyncCreated}} <tr {{bindAttr class=":component view.rangerTagsyncComponent.componentName"}}> <td class="summary-label"> <a href="#" {{action filterHosts view.rangerTagsyncComponent}}>{{t dashboard.services.ranger.rangerTagsyncs}}</a> http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/templates/main/service/services/storm.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/storm.hbs b/ambari-web/app/templates/main/service/services/storm.hbs index 2c552fc..71821d1 100644 --- a/ambari-web/app/templates/main/service/services/storm.hbs +++ b/ambari-web/app/templates/main/service/services/storm.hbs @@ -17,25 +17,26 @@ }} {{view App.SummaryMasterComponentsView mastersCompBinding="view.parentView.mastersObj"}} -<tr class="component SUPERVISOR"> - <td class="summary-label"> - <a href="#" {{action filterHosts view.filterComponent}}> - {{t dashboard.services.storm.supervisors}} - </a> - </td> - <td class="summary-value"> - {{#if App.router.clusterController.isServiceContentFullyLoaded}} - <span> - {{#view App.ComponentLiveTextView liveComponentsBinding="view.superVisorsLive" totalComponentsBinding="view.superVisorsTotal"}} - {{view.liveComponents}}/{{view.totalComponents}} - {{/view}} - </span> {{t services.service.summary.SupervisorsLIVE}} - {{else}} - {{t common.loading.eclipses}} - {{/if}} - </td> -</tr> - +{{#if view.isSupervisorCreated}} + <tr class="component SUPERVISOR"> + <td class="summary-label"> + <a href="#" {{action filterHosts view.filterComponent}}> + {{t dashboard.services.storm.supervisors}} + </a> + </td> + <td class="summary-value"> + {{#if App.router.clusterController.isServiceContentFullyLoaded}} + <span> + {{#view App.ComponentLiveTextView liveComponentsBinding="view.superVisorsLive" totalComponentsBinding="view.superVisorsTotal"}} + {{view.liveComponents}}/{{view.totalComponents}} + {{/view}} + </span> {{t services.service.summary.SupervisorsLIVE}} + {{else}} + {{t common.loading.eclipses}} + {{/if}} + </td> + </tr> +{{/if}} <!-- Divider-- make the remaining summary info on 2nd table--> </tbody> </table> http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/templates/main/service/services/yarn.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/yarn.hbs b/ambari-web/app/templates/main/service/services/yarn.hbs index 401b4a7..138742d 100644 --- a/ambari-web/app/templates/main/service/services/yarn.hbs +++ b/ambari-web/app/templates/main/service/services/yarn.hbs @@ -18,22 +18,24 @@ {{view view.dashboardMasterComponentView}} <!-- NodeManagers --> -<tr {{bindAttr class=":component view.nodeManagerComponent.componentName"}}> - <td class="summary-label"> - <a href="#" {{action filterHosts view.nodeManagerComponent}}>{{t dashboard.services.yarn.nodeManagers}}</a> - </td> - <td class="summary-value"> - {{#if App.router.clusterController.isServiceContentFullyLoaded}} - <span> - {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.nodeManagersStarted" totalComponentsBinding="view.service.nodeManagersTotal"}} - {{view.liveComponents}}/{{view.totalComponents}} - {{/view}} - </span>{{t common.started}} - {{else}} - {{t common.loading.eclipses}} - {{/if}} - </td> -</tr> +{{#if view.isNodeManagerCreated}} + <tr {{bindAttr class=":component view.nodeManagerComponent.componentName"}}> + <td class="summary-label"> + <a href="#" {{action filterHosts view.nodeManagerComponent}}>{{t dashboard.services.yarn.nodeManagers}}</a> + </td> + <td class="summary-value"> + {{#if App.router.clusterController.isServiceContentFullyLoaded}} + <span> + {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.nodeManagersStarted" totalComponentsBinding="view.service.nodeManagersTotal"}} + {{view.liveComponents}}/{{view.totalComponents}} + {{/view}} + </span>{{t common.started}} + {{else}} + {{t common.loading.eclipses}} + {{/if}} + </td> + </tr> +{{/if}} <!-- NodeManagers status --> <tr class="nodemanager-status"> <td class="summary-label">{{t dashboard.services.yarn.nodeManagers.status}}</td> http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/views/main/service/service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/service.js b/ambari-web/app/views/main/service/service.js index 28e7272..dc88f0b 100644 --- a/ambari-web/app/views/main/service/service.js +++ b/ambari-web/app/views/main/service/service.js @@ -167,7 +167,19 @@ App.MainDashboardServiceView = Em.View.extend(App.MainDashboardServiceViewWrappe title: this.t(template).format(len), component: clients.objectAt(0) }; - }.property('service') + }.property('service'), + + /** + * Check if service component is created + * @param componentName + * @returns {Boolean} + */ + isServiceComponentCreated: function (componentName) { + return App.MasterComponent.find().mapProperty('componentName').concat( + App.ClientComponent.find().mapProperty('componentName'), + App.SlaveComponent.find().mapProperty('componentName') + ).contains(componentName); + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/views/main/service/services/hbase.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/hbase.js b/ambari-web/app/views/main/service/services/hbase.js index deb1a1c..d2716aa 100644 --- a/ambari-web/app/views/main/service/services/hbase.js +++ b/ambari-web/app/views/main/service/services/hbase.js @@ -50,8 +50,6 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ phoenixServersText: Em.computed.countBasedMessage('service.phoenixServersTotal', '', Em.I18n.t('services.service.summary.viewHost'), Em.I18n.t('services.service.summary.viewHosts')), - showPhoenixInfo: Em.computed.bool('service.phoenixServersTotal'), - /** * One(!) active master component */ @@ -93,5 +91,13 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ phoenixServerComponent: Em.Object.create({ componentName: 'PHOENIX_QUERY_SERVER' - }) + }), + + isRegionServerCreated: function () { + return this.isServiceComponentCreated('HBASE_REGIONSERVER'); + }.property('App.router.clusterController.isComponentsStateLoaded'), + + isPhoenixQueryServerCreated: function () { + return this.isServiceComponentCreated('PHOENIX_QUERY_SERVER'); + }.property('App.router.clusterController.isComponentsStateLoaded') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/views/main/service/services/hdfs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/hdfs.js b/ambari-web/app/views/main/service/services/hdfs.js index eb9b2a9..4bc2cce 100644 --- a/ambari-web/app/views/main/service/services/hdfs.js +++ b/ambari-web/app/views/main/service/services/hdfs.js @@ -85,8 +85,6 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ dataNodesDead: Em.computed.alias('service.dataNodesInstalled'), - showJournalNodes: Em.computed.gt('service.journalNodes.length', 0), - journalNodesLive: function () { return this.get('service.journalNodes').filterProperty("workStatus", "STARTED").get("length"); }.property("[email protected]"), @@ -152,7 +150,7 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ isNfsInStack: function () { return App.StackServiceComponent.find().someProperty('componentName', 'NFS_GATEWAY'); }.property(), - + journalNodeComponent: Em.computed.alias('service.journalNodes.firstObject'), /** @@ -190,6 +188,13 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ */ isUpgradeStatusWarning: function () { return this.get('service.upgradeStatus') == 'false' && this.get('service.healthStatus') == 'green'; - }.property('service.upgradeStatus', 'service.healthStatus') + }.property('service.upgradeStatus', 'service.healthStatus'), + + isDataNodeCreated: function () { + return this.isServiceComponentCreated('DATANODE'); + }.property('App.router.clusterController.isComponentsStateLoaded'), + isJournalNodeCreated: function () { + return this.isServiceComponentCreated('JOURNALNODE'); + }.property('App.router.clusterController.isComponentsStateLoaded') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/views/main/service/services/ranger.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/ranger.js b/ambari-web/app/views/main/service/services/ranger.js index 3843277..f1dc6ab 100644 --- a/ambari-web/app/views/main/service/services/ranger.js +++ b/ambari-web/app/views/main/service/services/ranger.js @@ -27,13 +27,9 @@ App.MainDashboardServiceRangerView = App.MainDashboardServiceView.extend({ componentName: 'RANGER_TAGSYNC' }), - /** - * Define if RANGER_TAGSYNC is present in the installed stack - * @type {Boolean} - */ - isRangerTagsyncInStack: function () { - return App.StackServiceComponent.find().someProperty('componentName', 'RANGER_TAGSYNC'); - }.property(), + isRangerTagsyncCreated: function () { + return this.isServiceComponentCreated('RANGER_TAGSYNC'); + }.property('App.router.clusterController.isComponentsStateLoaded'), didInsertElement: function () { this.set('controller.isRangerUpdateWorking', true); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/views/main/service/services/storm.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/storm.js b/ambari-web/app/views/main/service/services/storm.js index 360a733..f657ef3 100644 --- a/ambari-web/app/views/main/service/services/storm.js +++ b/ambari-web/app/views/main/service/services/storm.js @@ -36,5 +36,9 @@ App.MainDashboardServiceStormView = App.MainDashboardServiceView.extend({ nimbusUptimeFormatted: function() { return this.get('service.nimbusUptime') || Em.I18n.t('services.service.summary.notRunning'); - }.property('service.nimbusUptime') + }.property('service.nimbusUptime'), + + isSupervisorCreated: function () { + return this.isServiceComponentCreated('SUPERVISOR'); + }.property('App.router.clusterController.isComponentsStateLoaded') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/app/views/main/service/services/yarn.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/yarn.js b/ambari-web/app/views/main/service/services/yarn.js index adb3eaf..7ccbfcf 100644 --- a/ambari-web/app/views/main/service/services/yarn.js +++ b/ambari-web/app/views/main/service/services/yarn.js @@ -86,5 +86,9 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({ willDestroyElement: function(){ $("[rel='queue-tooltip']").tooltip('destroy'); - } + }, + + isNodeManagerCreated: function () { + return this.isServiceComponentCreated('NODEMANAGER'); + }.property('App.router.clusterController.isComponentsStateLoaded') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/test/views/main/service/services/hdfs_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/service/services/hdfs_test.js b/ambari-web/test/views/main/service/services/hdfs_test.js index 45559e8..06d0e01 100644 --- a/ambari-web/test/views/main/service/services/hdfs_test.js +++ b/ambari-web/test/views/main/service/services/hdfs_test.js @@ -35,8 +35,6 @@ describe('App.MainDashboardServiceHdfsView', function () { App.TestAliases.testAsComputedAlias(getView(), 'journalNodesTotal', 'service.journalNodes.length', 'number'); - App.TestAliases.testAsComputedGt(getView(), 'showJournalNodes', 'service.journalNodes.length', 0); - describe("#Chart", function() { var chartView; @@ -368,4 +366,4 @@ describe('App.MainDashboardServiceHdfsView', function () { }); -}); \ No newline at end of file +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/0942cc0b/ambari-web/test/views/main/service/services/ranger_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/service/services/ranger_test.js b/ambari-web/test/views/main/service/services/ranger_test.js index daea5e0..6df1f5b 100644 --- a/ambari-web/test/views/main/service/services/ranger_test.js +++ b/ambari-web/test/views/main/service/services/ranger_test.js @@ -44,27 +44,4 @@ describe('App.MainDashboardServiceRangerView', function () { expect(view.get('controller.isRangerUpdateWorking')).to.be.false; }); }); - - describe("#isRangerTagsyncInStack", function() { - - beforeEach(function() { - this.mock = sinon.stub(App.StackServiceComponent, 'find'); - }); - afterEach(function() { - this.mock.restore(); - }); - - it("no RANGER_TAGSYNC component", function() { - this.mock.returns([]); - view.propertyDidChange('isRangerTagsyncInStack'); - expect(view.get('isRangerTagsyncInStack')).to.be.false; - }); - - it("NFS_GATEWAY component present", function() { - this.mock.returns([{componentName: 'RANGER_TAGSYNC'}]); - view.propertyDidChange('isRangerTagsyncInStack'); - expect(view.get('isRangerTagsyncInStack')).to.be.true; - }); - }); - }); \ No newline at end of file
