Forráskód Böngészése

AMBARI-6322. Choosing bulk hosts to decommission on 120 node cluster on the hosts page just spins. (srimanth)

Srimanth Gunturi 11 éve
szülő
commit
7a7d8e1c8d
1 módosított fájl, 14 hozzáadás és 2 törlés
  1. 14 2
      ambari-web/app/views/main/host.js

+ 14 - 2
ambari-web/app/views/main/host.js

@@ -453,9 +453,21 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, {
     var hostNames = hosts.mapProperty('hostName');
     var hostsToSkip = [];
     if (operationData.action == "DECOMMISSION") {
+      var hostComponentStatusMap = {}; // "DATANODE_c6401.ambari.apache.org" => "STARTED"
+      var hostComponentIdMap = {}; // "DATANODE_c6401.ambari.apache.org" => "DATANODE"
+      if (json.items) {
+        json.items.forEach(function(host) {
+          if (host.host_components) {
+            host.host_components.forEach(function(component) {
+              hostComponentStatusMap[component.id] = component.HostRoles.state;
+              hostComponentIdMap[component.id] = component.HostRoles.component_name;
+            });
+          }
+        });
+      }
       hostsToSkip = hosts.filter(function(host) {
-        var invalidStateComponents = host.get('hostComponents').filter(function(component) {
-          return component.get('componentName') == operationData.realComponentName && component.get('workStatus') == 'INSTALLED';
+        var invalidStateComponents = host.hostComponents.filter(function(component) {
+          return hostComponentIdMap[component] == operationData.realComponentName && hostComponentStatusMap[component] == 'INSTALLED';
         });
         return invalidStateComponents.length > 0;
       });