ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-14030. Datanode shows up prematurely as 'Decomissioned' in Ambari UI while it is 'Decomissioning in Progress' in Namenode UI.(xiwang)
Date Tue, 24 Nov 2015 23:19:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a8e46494c -> fa0985c2b


AMBARI-14030. Datanode shows up prematurely as 'Decomissioned' in Ambari UI while it is 'Decomissioning
in Progress' in Namenode UI.(xiwang)


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

Branch: refs/heads/branch-2.1
Commit: fa0985c2bf4234e63250ae7f0fd7a39d8e4e0ad1
Parents: a8e4649
Author: Xi Wang <xiwang@apache.org>
Authored: Mon Nov 23 19:14:32 2015 -0800
Committer: Xi Wang <xiwang@apache.org>
Committed: Tue Nov 24 15:19:00 2015 -0800

----------------------------------------------------------------------
 .../host_component_views/datanode_view.js       | 30 +++++++++++---------
 1 file changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa0985c2/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js
b/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js
index 64bc775..f7178cc 100644
--- a/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js
+++ b/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js
@@ -86,22 +86,24 @@ App.DataNodeComponentView = App.HostComponentView.extend(App.Decommissionable,
{
     if (curObj) {
       var liveNodesJson = App.parseJSON(curObj.LiveNodes);
       // HDP-2 stack
-      if (liveNodesJson && liveNodesJson[hostName]) {
-        switch (liveNodesJson[hostName].adminState) {
-          case "In Service":
-            this.setStatusAs('INSERVICE');
-            break;
-          case "Decommission In Progress":
-            this.setStatusAs('DECOMMISSIONING');
-            break;
-          case "Decommissioned":
-            this.setStatusAs('DECOMMISSIONED');
-            break;
+      for (var hostPort in liveNodesJson) {
+        if(hostPort.indexOf(hostName) == 0) {
+          switch (liveNodesJson[hostPort].adminState) {
+            case "In Service":
+              this.setStatusAs('INSERVICE');
+              break;
+            case "Decommission In Progress":
+              this.setStatusAs('DECOMMISSIONING');
+              break;
+            case "Decommissioned":
+              this.setStatusAs('DECOMMISSIONED');
+              break;
+          }
+          return;
         }
-      } else {
-        // if namenode is down, get desired_admin_state to decide if the user had issued
a decommission
-        this.getDesiredAdminState();
       }
+      // if namenode is down, get desired_admin_state to decide if the user had issued a
decommission
+      this.getDesiredAdminState();
     }
   }
 });


Mime
View raw message