Updated Branches: refs/heads/trunk c6c4e3483 -> 2b6b4a9b0
AMBARI-3667. HBase UI Master status. (alexantonenko via 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/2b6b4a9b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/2b6b4a9b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/2b6b4a9b Branch: refs/heads/trunk Commit: 2b6b4a9b0ff184750489f30bf976b74b49deadca Parents: c6c4e34 Author: Srimanth Gunturi <[email protected]> Authored: Fri Nov 1 14:48:16 2013 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Fri Nov 1 14:48:16 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/controllers/global/cluster_controller.js | 2 +- ambari-web/app/controllers/global/update_controller.js | 4 ++++ ambari-web/app/mappers/service_mapper.js | 4 +++- ambari-web/app/mappers/status_mapper.js | 8 +++----- ambari-web/app/views/common/quick_view_link_view.js | 2 +- ambari-web/app/views/main/dashboard/service/hbase.js | 4 ++-- ambari-web/app/views/main/dashboard/widgets/hbase_links.js | 4 ++-- 7 files changed, 16 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/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 492ed3d..5699193 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -269,7 +269,7 @@ 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,components/host_components/HostRoles/ha_status'); + var servicesUrl = this.getUrl(testUrl, '/services?fields=ServiceInfo,components/host_components/HostRoles/state'); App.HttpClient.get(servicesUrl, App.statusMapper, { complete: callback http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/ambari-web/app/controllers/global/update_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js index 68c2977..a30307e 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -92,6 +92,10 @@ App.UpdateController = Em.Controller.extend({ { name: 'YARN', urlParam: 'yarn/Queue' + }, + { + name: 'HBASE', + urlParam: 'hbase/master/IsActiveMaster' } ]; services.forEach(function(service) { http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/ambari-web/app/mappers/service_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js index 1106da8..3d652a7 100644 --- a/ambari-web/app/mappers/service_mapper.js +++ b/ambari-web/app/mappers/service_mapper.js @@ -164,7 +164,6 @@ App.servicesMapper = App.QuickDataMapper.create({ work_status: 'HostRoles.state', desired_status: 'HostRoles.desired_state', component_name: 'HostRoles.component_name', - ha_status: 'HostRoles.ha_status', host_id: 'HostRoles.host_name', stale_configs: 'HostRoles.stale_configs', $service_id: 'none' /* will be set outside of parse function */ @@ -246,6 +245,9 @@ App.servicesMapper = App.QuickDataMapper.create({ item.components.forEach(function(component){ var service = component.ServiceComponentInfo.service_name; component.host_components.forEach(function(host_component){ + if(host_component.HostRoles.component_name == "HBASE_MASTER"){ + this.config3.ha_status = 'metrics.hbase.master.IsActiveMaster'; + } var comp = this.parseIt(host_component, this.config3); comp.service_id = service; this.calculateState(comp); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/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 5630f97..c935738 100644 --- a/ambari-web/app/mappers/status_mapper.js +++ b/ambari-web/app/mappers/status_mapper.js @@ -48,7 +48,6 @@ App.statusMapper = App.QuickDataMapper.create({ var item = result[hostComponent.get('id')]; if (item) { hostComponent.set('workStatus', item.work_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')]); } @@ -123,7 +122,7 @@ App.statusMapper = App.QuickDataMapper.create({ ? (hostComponent.get('workStatus') === App.HostComponentStatus.stopped) : true; service.isHbaseActive = (!service.isHbaseActive) - ? (hostComponent.get('haStatus') === 'active') + ? (hostComponent.get('haStatus') === 'true') : true; service.masterComponents.push(hostComponent); @@ -161,7 +160,7 @@ App.statusMapper = App.QuickDataMapper.create({ } } else if(hostComponent.get('componentName') === 'HBASE_MASTER') { if (hostComponent.get('workStatus') === 'STARTED') { - hostComponent.get('haStatus') == 'active' ? hostComponent.set('displayNameAdvanced', this.t('dashboard.services.hbase.masterServer.active')) : hostComponent.set('displayNameAdvanced', this.t('dashboard.services.hbase.masterServer.standby')); + hostComponent.get('haStatus') == 'true' ? hostComponent.set('displayNameAdvanced', this.t('dashboard.services.hbase.masterServer.active')) : hostComponent.set('displayNameAdvanced', this.t('dashboard.services.hbase.masterServer.standby')); } else { hostComponent.set('displayNameAdvanced', null); } @@ -325,8 +324,7 @@ App.statusMapper = App.QuickDataMapper.create({ component.host_components.forEach(function (host_component) { host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name; result[host_component.id] = { - work_status: host_component.HostRoles.state, - ha_status: host_component.HostRoles.ha_status + work_status: host_component.HostRoles.state }; }, this) }, this) http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/ambari-web/app/views/common/quick_view_link_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js index 42738cd..b9f4a0d 100644 --- a/ambari-web/app/views/common/quick_view_link_view.js +++ b/ambari-web/app/views/common/quick_view_link_view.js @@ -104,7 +104,7 @@ App.QuickViewLinks = Em.View.extend({ case "HBASE": var component; if (App.supports.multipleHBaseMasters) { - component = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active'); + component = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'true'); } else { component = components.findProperty('componentName', 'HBASE_MASTER'); } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/ambari-web/app/views/main/dashboard/service/hbase.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/service/hbase.js b/ambari-web/app/views/main/dashboard/service/hbase.js index 0a6b610..91365c0 100644 --- a/ambari-web/app/views/main/dashboard/service/hbase.js +++ b/ambari-web/app/views/main/dashboard/service/hbase.js @@ -33,7 +33,7 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ */ passiveMasters: function () { if(App.supports.multipleHBaseMasters){ - return this.get('masters').filterProperty('haStatus', 'passive'); + return this.get('masters').filterProperty('haStatus', 'false'); } return []; }.property('masters'), @@ -73,7 +73,7 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ */ activeMaster: function () { if(App.supports.multipleHBaseMasters){ - return this.get('masters').findProperty('haStatus', 'active'); + return this.get('masters').findProperty('haStatus', 'true'); } else { return this.get('masters')[0]; } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2b6b4a9b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js index bbac1ac..fc1e1d6 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js @@ -41,7 +41,7 @@ App.HBaseLinksView = App.LinkDashboardWidgetView.extend({ */ passiveMasters: function () { if (App.supports.multipleHBaseMasters) { - return this.get('masters').filterProperty('haStatus', 'passive'); + return this.get('masters').filterProperty('haStatus', 'false'); } return []; }.property('masters'), @@ -56,7 +56,7 @@ App.HBaseLinksView = App.LinkDashboardWidgetView.extend({ */ activeMaster: function () { if(App.supports.multipleHBaseMasters) { - return this.get('masters').findProperty('haStatus', 'active'); + return this.get('masters').findProperty('haStatus', 'true'); } else { return this.get('masters')[0]; }
