You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/04/10 00:13:34 UTC

svn commit: r1466264 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/messages.js ambari-web/app/models/service.js ambari-web/app/templates/main/dashboard/service/hbase.hbs ambari-web/app/views/common/quick_view_link_view.js

Author: srimanth
Date: Tue Apr  9 22:13:33 2013
New Revision: 1466264

URL: http://svn.apache.org/r1466264
Log:
AMBARI-1851. Ambari Web behaves strangely when there is no Active HBase Master. (srimanth)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/models/service.js
    incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
    incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1466264&r1=1466263&r2=1466264&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Apr  9 22:13:33 2013
@@ -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 

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1466264&r1=1466263&r2=1466264&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Tue Apr  9 22:13:33 2013
@@ -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',

Modified: incubator/ambari/trunk/ambari-web/app/models/service.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/service.js?rev=1466264&r1=1466263&r2=1466264&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/service.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/service.js Tue Apr  9 22:13:33 2013
@@ -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');
+      }
+    }
   },
 
   /**

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs?rev=1466264&r1=1466263&r2=1466264&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs Tue Apr  9 22:13:33 2013
@@ -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 -->

Modified: incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js?rev=1466264&r1=1466263&r2=1466264&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/common/quick_view_link_view.js Tue Apr  9 22:13:33 2013
@@ -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')
 
 });