Просмотр исходного кода

AMBARI-1851. Ambari Web behaves strangely when there is no Active HBase Master. (srimanth)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1466264 13f79535-47bb-0310-9956-ffa450edef68
Srimanth 12 лет назад
Родитель
Сommit
7cc40a245c

+ 3 - 0
CHANGES.txt

@@ -670,6 +670,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1851. Ambari Web behaves strangely when there is no Active HBase 
+ Master. (srimanth)
+
  AMBARI-1849. Cosmetic problems on HBase Dashboard. (srimanth)
 
  AMBARI-1848. Install Wizard, Step 7: Oozie Database Derby option should say 

+ 1 - 0
ambari-web/app/messages.js

@@ -972,6 +972,7 @@ Em.I18n.translations = {
 
   'dashboard.services.hbase.summary':'{0} region servers with {1} average load',
   'dashboard.services.hbase.masterServer':'HBase Master',
+  'dashboard.services.hbase.noMasterServer':'No Active Master',
   'dashboard.services.hbase.masterServerHeap':'Master Heap',
   'dashboard.services.hbase.masterServerHeap.summary':'{0} / {1} ({2}% used)',
   'dashboard.services.hbase.masterServerUptime':'Master Server Uptime',

+ 7 - 0
ambari-web/app/models/service.js

@@ -61,6 +61,13 @@ App.Service = DS.Model.extend({
     } else {
       this.set('healthStatus', 'red-blinking');
     }
+
+    if (this.get('serviceName') === 'HBASE') {
+      var active = this.get('hostComponents').findProperty('haStatus', 'active');
+      if (!active) {
+        this.set('healthStatus', 'red');
+      }
+    }
   },
 
   /**

+ 13 - 4
ambari-web/app/templates/main/dashboard/service/hbase.hbs

@@ -45,9 +45,13 @@
       <tr>
         <td>{{t dashboard.services.hbase.masterServer}}</td>
         <td>
-            <a href="#" {{action showDetails view.activeMaster.host}}>{{t service.hbase.activeMaster}}</a>
-            {{#if view.passiveMasters.length}}
-                {{view.passiveMasterOutput}}
+            {{#if view.activeMaster}}
+              <a href="#" {{action showDetails view.activeMaster.host}}>{{t service.hbase.activeMaster}}</a>
+              {{#if view.passiveMasters.length}}
+                  {{view.passiveMasterOutput}}
+              {{/if}}
+            {{else}}
+              {{t dashboard.services.hbase.noMasterServer}}
             {{/if}}
         </td>
       </tr>
@@ -64,7 +68,12 @@
       <!-- HBaseMaster Web UI -->
       <tr>
         <td>{{t dashboard.services.hbase.masterWebUI}}</td>
-        <td><a {{bindAttr href="view.hbaseMasterWebUrl"}} target="_blank">{{view.activeMaster.host.publicHostName}}:60010</a>
+        <td>
+            {{#if view.activeMaster}}
+              <a {{bindAttr href="view.hbaseMasterWebUrl"}} target="_blank">{{view.activeMaster.host.publicHostName}}:60010</a>
+            {{else}}
+              {{t services.service.summary.notAvailable}}
+            {{/if}}
         </td>
       </tr>
       <!-- Regions in Transition -->

+ 4 - 20
ambari-web/app/views/common/quick_view_link_view.js

@@ -37,11 +37,9 @@ App.QuickViewLinks = Em.View.extend({
     } else if (serviceName === 'HBASE') {
       if (components.filterProperty('componentName', 'HBASE_MASTER').someProperty('haStatus', 'active')) {
         host = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active').get('host.publicHostName');
-      } else {
-        // TODO: show error message
-        if (!this.get('errorFlag')) {
-          this.noActiveHbaseMasterError();
-        }
+      }
+      else {
+        this.set('errorFlag', true);
       }
     }
     if (!host) {
@@ -66,20 +64,6 @@ App.QuickViewLinks = Em.View.extend({
         return "";
         break;
     }
-  }.property('service'),
-
-  noActiveHbaseMasterError: function () {
-    this.set('errorFlag', true);
-    App.ModalPopup.show({
-      header: Em.I18n.translations['common.error'],
-      secondary: false,
-      onPrimary: function () {
-        this.hide();
-      },
-      bodyClass: Ember.View.extend({
-        template: Ember.Handlebars.compile('<p>{{t services.hbase.master.error}}</p>')
-      })
-    });
-  }
+  }.property('service')
 
 });