incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: AMBARI-3209. After NameNode HA is enabled, HDFS Summary should show which NameNode is Active/Standby in HDFS Summary. (Andrii Babiichuk and xiwang via yusaku)
Date Fri, 13 Sep 2013 18:29:16 GMT
Updated Branches:
  refs/heads/trunk 7a32144ed -> 2675d8c22


AMBARI-3209. After NameNode HA is enabled, HDFS Summary should show which NameNode is Active/Standby
in HDFS Summary. (Andrii Babiichuk and xiwang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/2675d8c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/2675d8c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/2675d8c2

Branch: refs/heads/trunk
Commit: 2675d8c226cb375a9bb235b1cd37318eed6ae2be
Parents: 7a32144
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Fri Sep 13 11:28:47 2013 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Fri Sep 13 11:28:47 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  2 +
 .../app/templates/main/service/info/summary.hbs |  2 +-
 .../service/info/summary/master_components.hbs  |  8 +++-
 .../app/views/main/dashboard/service/hdfs.js    | 49 +++++++++++++++++++-
 4 files changed, 57 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2675d8c2/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 6aba592..74005c7 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -866,6 +866,8 @@ Em.I18n.translations = {
   'services.service.summary.nameNode':'NameNode Web UI',
   'services.service.summary.nameNodeUptime':'NameNode Uptime',
   'services.service.summary.nameNodeHeap':'NameNode Heap',
+  'services.service.summary.nameNode.active':'Active NameNode',
+  'services.service.summary.nameNode.standby':'Standby NameNode',
   'services.service.summary.pendingUpgradeStatus':'Upgrade Status',
   'services.service.summary.pendingUpgradeStatus.pending':'Pending upgrade',
   'services.service.summary.pendingUpgradeStatus.notPending':'No pending upgrade',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2675d8c2/ambari-web/app/templates/main/service/info/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs
index bff363c..6f8b18b 100644
--- a/ambari-web/app/templates/main/service/info/summary.hbs
+++ b/ambari-web/app/templates/main/service/info/summary.hbs
@@ -54,7 +54,7 @@
                       <span class="green-live">{{view.clients.length}}</span>
                       {{component.displayName}} {{#if view.hasManyClients}}s{{/if}} {{t common.installed}}
                       <div class="summary-view-host">
-                        <a {{action filterHosts component}} href="javascript:void(null)>{{view.clientsHostText}}</a>
+                        <a {{action filterHosts component}} href="javascript:void(null)">{{view.clientsHostText}}</a>
                       </div>
                     </td>
                   </tr>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2675d8c2/ambari-web/app/templates/main/service/info/summary/master_components.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/master_components.hbs b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
index 0603be4..c30eb6e 100644
--- a/ambari-web/app/templates/main/service/info/summary/master_components.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
@@ -18,7 +18,13 @@
 
 {{#each masterComp in view.mastersComp}}
   <tr>
-   <td>{{masterComp.displayName}}</td>
+     <td>
+       {{#if masterComp.displayNameAdvanced}}
+         {{masterComp.displayNameAdvanced}}
+       {{else}}
+         {{masterComp.displayName}}
+       {{/if}}
+     </td>
    <td>
      <span {{bindAttr class="masterComp.workStatus"}}></span>
      {{masterComp.componentTextStatus}}

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2675d8c2/ambari-web/app/views/main/dashboard/service/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js b/ambari-web/app/views/main/dashboard/service/hdfs.js
index d45b7b1..863b807 100644
--- a/ambari-web/app/views/main/dashboard/service/hdfs.js
+++ b/ambari-web/app/views/main/dashboard/service/hdfs.js
@@ -40,10 +40,55 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   dashboardMasterComponentView: Em.View.extend({
     templateName: require('templates/main/service/info/summary/master_components'),
     mastersComp : function() {
-      return this.get('parentView.service.hostComponents').filter(function(comp){
+      var masters = this.get('parentView.service.hostComponents').filter(function(comp){
         return comp.get('isMaster') && comp.get('componentName') !== 'JOURNALNODE';
       });
-    }.property("service")
+      // enabled HA
+      if (!masters.findProperty('componentName', 'SECONDARY_NAMENODE') || masters.findProperty('componentName',
'SECONDARY_NAMENODE').get('workStatus') == 'MAINTENANCE') {
+        masters = this.setNNDisplayName();
+      }
+      return masters;
+    }.property('service'),
+    setNNDisplayName: function () {
+      var masters = this.get('parentView.service.hostComponents').filter(function(comp){
+        return comp.get('isMaster') && comp.get('componentName') !== 'JOURNALNODE';
+      });
+      var hostName0 = masters[0].get('host.hostName');
+      var activeNN = this.get('parentView.service.activeNameNode');
+      var standbyNN1 = this.get('parentView.service.standbyNameNode');
+      var standbyNN2 = this.get('parentView.service.standbyNameNode2');
+      if (activeNN) {
+        // 0 is always active
+        if (hostName0 == activeNN.get('hostName')) {
+          masters[0].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.active'));
+        } else {
+          masters[1].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.active'));
+          var temp = masters[0];
+          masters[0] = masters[1];
+          masters[1] = temp;
+        }
+        if (standbyNN1) {
+          masters[1].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.standby'));
+        } else {
+          masters[1].set('displayNameAdvanced', null);
+        }
+      } else if (!activeNN && standbyNN2 && standbyNN1) {
+        masters[0].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.standby'));
+        masters[1].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.standby'));
+      } else if (!activeNN && standbyNN1 && !standbyNN2) {
+        if (hostName0 == standbyNN1.get('hostName')) {
+          masters[0].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.standby'));
+          masters[1].set('displayNameAdvanced', null);
+        } else {
+          masters[1].set('displayNameAdvanced', Em.I18n.t('services.service.summary.nameNode.standby'));
+          masters[0].set('displayNameAdvanced', null);
+        }
+      } else if (!activeNN && !standbyNN1 && !standbyNN2) {
+        masters[0].set('displayNameAdvanced', null);
+        masters[1].set('displayNameAdvanced', null);
+      }
+      return masters;
+    }.observes('parentView.service.activeNameNode', 'parentView.service.standbyNameNode','parentView.service.standbyNameNode2')
   }),
 
   dataNodesLive: function(){


Mime
View raw message