ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject git commit: AMBARI-6322. Choosing bulk hosts to decommission on 120 node cluster on the hosts page just spins. (srimanth)
Date Mon, 30 Jun 2014 22:58:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 96bad666f -> 7a7d8e1c8


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


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

Branch: refs/heads/trunk
Commit: 7a7d8e1c8d739f331aa42c858d6cd7b6e8d963eb
Parents: 96bad66
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Mon Jun 30 15:37:56 2014 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Mon Jun 30 15:57:59 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/views/main/host.js | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a7d8e1c/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index 106c384..8de4434 100644
--- a/ambari-web/app/views/main/host.js
+++ b/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;
       });


Mime
View raw message