Browse Source

Revert "AMBARI-3277. HDFS shows red when NameNode HA is enabled. (xiwang via yusaku)"

This reverts commit 074d8395ea8f727fa54b58700ef5cab6382d0af9.
Yusaku Sako 11 năm trước cách đây
mục cha
commit
dd2a1f8d1d
2 tập tin đã thay đổi với 6 bổ sung17 xóa
  1. 6 10
      ambari-web/app/models/service.js
  2. 0 7
      ambari-web/app/models/service/hdfs.js

+ 6 - 10
ambari-web/app/models/service.js

@@ -71,7 +71,8 @@ App.Service = DS.Model.extend({
       serviceName = this.get('serviceName'),
       isRunning = true,
       runningHCs = [],
-      unknownHCs = [];
+      unknownHCs = [],
+      hdfsHealthStatus;
 
     //look through all components to find out common statuses
     this.get('hostComponents').forEach(function (_hostComponent) {
@@ -132,21 +133,16 @@ App.Service = DS.Model.extend({
       }
     }
 
-    /**
-     * Both App.HDFSService and its parent (App.Service) can hit this block.
-     * We need a property: App.HDFSService.hdfsHealthStatus to store the correct status.
-     * When App.HDFSService get in, we store the status in that property based on if activeNN existed.
-     * When App.Service get in, we get correct health status from that property.
-     */
     if (isGreen && serviceName === 'HDFS' && masterComponents.length == 5) { // enabled HA
       var activeNN = this.get('activeNameNode');
       var nameNode = this.get('nameNode');
+
       if (nameNode && !activeNN) { //hdfs model but no active NN
-        App.HDFSService.hdfsHealthStatus = 'red';
+        hdfsHealthStatus = 'red';
       } else if (nameNode && activeNN) {
-        App.HDFSService.hdfsHealthStatus = 'green';
+        hdfsHealthStatus = 'green';
       }
-      this.set('healthStatus', App.HDFSService.hdfsHealthStatus);
+      this.set('healthStatus', hdfsHealthStatus);
     }
 
     this.set('isStarted', everyStarted);

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

@@ -46,11 +46,4 @@ App.HDFSService = App.Service.extend({
   nameNodeRpc: DS.attr('number')
 });
 
-/**
- * Use this property only in its parent class to store hdfs health status.
- */
-App.HDFSService.reopenClass({
-  hdfsHealthStatus: ''
-});
-
 App.HDFSService.FIXTURES = [];