Selaa lähdekoodia

AMBARI-3667. HBase UI Master status. (alexantonenko via srimanth)

Srimanth Gunturi 11 vuotta sitten
vanhempi
commit
2b6b4a9b0f

+ 1 - 1
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

+ 4 - 0
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) {

+ 3 - 1
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);

+ 3 - 5
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)

+ 1 - 1
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');
         }

+ 2 - 2
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];
     }

+ 2 - 2
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];
     }