Updated Branches: refs/heads/trunk 85b85ddac -> 95d63f0ed
AMBARI-3674. UI does not update active hbase master in display. (srimanth) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/95d63f0e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/95d63f0e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/95d63f0e Branch: refs/heads/trunk Commit: 95d63f0ed549469e85cdc4055b534e2179fe0621 Parents: 85b85dd Author: Srimanth Gunturi <[email protected]> Authored: Fri Nov 1 17:57:01 2013 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Fri Nov 1 17:57:06 2013 -0700 ---------------------------------------------------------------------- .../app/controllers/global/cluster_controller.js | 5 +++++ ambari-web/app/mappers/status_mapper.js | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/95d63f0e/ambari-web/app/controllers/global/cluster_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index 5699193..be350d8 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -270,6 +270,11 @@ App.ClusterController = Em.Controller.extend({ var testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json'; //desired_state property is eliminated since calculateState function is commented out, it become useless var servicesUrl = this.getUrl(testUrl, '/services?fields=ServiceInfo,components/host_components/HostRoles/state'); + if (App.Service.find('HBASE')) { + // HBase installed. We need the haStatus field as it has + // moved to another field. + servicesUrl += ',components/host_components/metrics/hbase/master/IsActiveMaster'; + } App.HttpClient.get(servicesUrl, App.statusMapper, { complete: callback http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/95d63f0e/ambari-web/app/mappers/status_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/status_mapper.js b/ambari-web/app/mappers/status_mapper.js index c935738..18a9bf5 100644 --- a/ambari-web/app/mappers/status_mapper.js +++ b/ambari-web/app/mappers/status_mapper.js @@ -24,12 +24,6 @@ App.statusMapper = App.QuickDataMapper.create({ work_status:'ServiceInfo.state' }, - config3:{ - id:'id', - work_status:'HostRoles.state', - desired_status: 'HostRoles.desired_state' - }, - map:function (json) { var start = new Date().getTime(); console.log('in status mapper'); @@ -48,6 +42,9 @@ App.statusMapper = App.QuickDataMapper.create({ var item = result[hostComponent.get('id')]; if (item) { hostComponent.set('workStatus', item.work_status); + if (item.ha_status) { + hostComponent.set('haStatus', item.ha_status); + } this.countHostComponents(hostComponent, hostsMap, hostsMap[hostComponent.get('host.id')]); this.countServiceComponents(hostComponent, servicesMap, servicesMap[hostComponent.get('service.id')]); } @@ -326,6 +323,12 @@ App.statusMapper = App.QuickDataMapper.create({ result[host_component.id] = { work_status: host_component.HostRoles.state }; + if (host_component.metrics && + host_component.metrics.hbase && + host_component.metrics.hbase.master && + host_component.metrics.hbase.master.IsActiveMaster) { + result[host_component.id]['ha_status'] = host_component.metrics.hbase.master.IsActiveMaster; + } }, this) }, this) }, this);
