Updated Branches:
  refs/heads/trunk 534f78953 -> 735628b72

AMBARI-3234. HDFS service status is shown as green when there is no Active 
NameNode. (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/735628b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/735628b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/735628b7

Branch: refs/heads/trunk
Commit: 735628b72e614dbcbc1a5fec514b81882143b5b2
Parents: 534f789
Author: Yusaku Sako <[email protected]>
Authored: Fri Sep 13 15:28:43 2013 -0700
Committer: Yusaku Sako <[email protected]>
Committed: Fri Sep 13 15:28:43 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/mappers/service_mapper.js |  2 +-
 ambari-web/app/models/service.js         | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/735628b7/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 bcbc8f5..cacc627 100644
--- a/ambari-web/app/mappers/service_mapper.js
+++ b/ambari-web/app/mappers/service_mapper.js
@@ -391,7 +391,7 @@ App.servicesMapper = App.QuickDataMapper.create({
         item.nameNodeComponent = component;
         finalConfig = jQuery.extend(finalConfig, hdfsConfig);
         // Get the live, dead & decommission nodes from string json
-        if (component.host_components[0].metrics && 
component.host_components[0].metrics.dfs.namenode) {
+        if (component.host_components[0].metrics && 
component.host_components[0].metrics.dfs && 
component.host_components[0].metrics.dfs.namenode) {
           var liveNodesJson = 
App.parseJSON(component.host_components[0].metrics.dfs.namenode.LiveNodes);
           var deadNodesJson = 
App.parseJSON(component.host_components[0].metrics.dfs.namenode.DeadNodes);
           var decommissionNodesJson = 
App.parseJSON(component.host_components[0].metrics.dfs.namenode.DecomNodes);

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/735628b7/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index faf4efb..dd0ceac 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -67,6 +67,18 @@ App.Service = DS.Model.extend({
         this.set('healthStatus', 'red');
       }
     }
+
+    if (isGreen && this.get('serviceName') === 'HDFS' && components.length == 
5) { // enabled HA
+      var activeNN = this.get('activeNameNode');
+      var nameNode = this.get('nameNode');
+
+      if (nameNode && !activeNN) { //hdfs model but no active NN
+        hdfsHealthStatus = 'red';
+      } else if (nameNode && activeNN) {
+        hdfsHealthStatus = 'green';
+      }
+      this.set('healthStatus', hdfsHealthStatus);
+    }
   },
 
   /**

Reply via email to