ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject git commit: AMBARI-6298. Custom Command execution takes too long. (mpapirkovskyy)
Date Thu, 26 Jun 2014 22:26:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4431985c7 -> 6058debb8


AMBARI-6298. Custom Command execution takes too long. (mpapirkovskyy)


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

Branch: refs/heads/trunk
Commit: 6058debb8ad813037993949ce2c675b4b4e2b33d
Parents: 4431985
Author: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Authored: Fri Jun 27 01:20:29 2014 +0300
Committer: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Committed: Fri Jun 27 01:20:29 2014 +0300

----------------------------------------------------------------------
 .../AmbariCustomCommandExecutionHelper.java     |  2 --
 .../AmbariManagementControllerTest.java         | 24 --------------------
 2 files changed, 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6058debb/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 5ac882d..403d6a2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -253,8 +253,6 @@ public class AmbariCustomCommandExecutionHelper {
       execCmd.setConfigurations(configurations);
       execCmd.setConfigurationTags(configTags);
 
-      execCmd.setClusterHostInfo(
-          StageUtils.getClusterHostInfo(clusters.getHostsForCluster(clusterName), cluster));
 
       hostLevelParams.put(CUSTOM_COMMAND, commandName);
       // Set parameters required for re-installing clients on restart

http://git-wip-us.apache.org/repos/asf/ambari/blob/6058debb/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index 7816ad4..891eded 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -2405,11 +2405,6 @@ public class AmbariManagementControllerTest {
     Assert.assertEquals("false", cmdParams.get("mark_draining_only"));
     Assert.assertEquals(Role.HBASE_MASTER, command.getRole());
     Assert.assertEquals(RoleCommand.CUSTOM_COMMAND, command.getRoleCommand());
-    Map<String, Set<String>> cInfo = execCmd.getClusterHostInfo();
-    Assert.assertTrue(cInfo.containsKey("decom_hbase_rs_hosts"));
-    Assert.assertTrue(cInfo.get("decom_hbase_rs_hosts").size() == 1);
-    Assert.assertEquals("h2",
-        cInfo.get("all_hosts").toArray()[Integer.parseInt(cInfo.get("decom_hbase_rs_hosts").iterator().next())]);
     Assert.assertEquals("DECOMMISSION", execCmd.getHostLevelParams().get("custom_command"));
 
     // RS stops
@@ -2436,8 +2431,6 @@ public class AmbariManagementControllerTest {
     Assert.assertEquals(1, storedTasks.size());
     Assert.assertEquals(HostComponentAdminState.DECOMMISSIONED, scHost.getComponentAdminState());
     Assert.assertEquals(MaintenanceState.ON, scHost.getMaintenanceState());
-    cInfo = execCmd.getClusterHostInfo();
-    Assert.assertTrue(cInfo.containsKey("decom_hbase_rs_hosts"));
     command = storedTasks.get(0);
     Assert.assertEquals("DECOMMISSION", execCmd.getHostLevelParams().get("custom_command"));
     Assert.assertTrue("DECOMMISSION, Excluded: h2".equals(command.getCommandDetail()));
@@ -2474,8 +2467,6 @@ public class AmbariManagementControllerTest {
     Assert.assertEquals("", cmdParams.get("excluded_hosts"));
     Assert.assertEquals(Role.HBASE_MASTER, command.getRole());
     Assert.assertEquals(RoleCommand.CUSTOM_COMMAND, command.getRoleCommand());
-    cInfo = execCmd.getClusterHostInfo();
-    Assert.assertFalse(cInfo.containsKey("decom_hbase_rs_hosts"));
     Assert.assertEquals("DECOMMISSION", execCmd.getHostLevelParams().get("custom_command"));
   }
 
@@ -6055,11 +6046,6 @@ public class AmbariManagementControllerTest {
     HostRoleCommand command =  storedTasks.get(0);
     Assert.assertEquals(Role.NAMENODE, command.getRole());
     Assert.assertEquals(RoleCommand.CUSTOM_COMMAND, command.getRoleCommand());
-    Map<String, Set<String>> cInfo = execCmd.getClusterHostInfo();
-    Assert.assertTrue(cInfo.containsKey("decom_dn_hosts"));
-    Assert.assertTrue(cInfo.get("decom_dn_hosts").size() == 1);
-    Assert.assertEquals("h2",
-        cInfo.get("all_hosts").toArray()[Integer.parseInt(cInfo.get("decom_dn_hosts").iterator().next())]);
     Assert.assertEquals("DECOMMISSION", execCmd.getHostLevelParams().get("custom_command"));
 
     // Decommission the other datanode
@@ -6085,9 +6071,6 @@ public class AmbariManagementControllerTest {
     Assert.assertEquals(1, storedTasks.size());
     Assert.assertEquals(HostComponentAdminState.DECOMMISSIONED, scHost.getComponentAdminState());
     Assert.assertEquals(MaintenanceState.ON, scHost.getMaintenanceState());
-    cInfo = execCmd.getClusterHostInfo();
-    Assert.assertTrue(cInfo.containsKey("decom_dn_hosts"));
-    Assert.assertEquals("0,1", cInfo.get("decom_dn_hosts").iterator().next());
     Assert.assertEquals("DECOMMISSION", execCmd.getHostLevelParams().get("custom_command"));
 
     // Recommission the other datanode  (while adding NameNode HA)
@@ -6127,8 +6110,6 @@ public class AmbariManagementControllerTest {
         ().getExecutionCommand();
     Assert.assertNotNull(storedTasks);
     Assert.assertEquals(2, storedTasks.size());
-    cInfo = execCmd.getClusterHostInfo();
-    Assert.assertFalse(cInfo.containsKey("decom_dn_hosts"));
     int countRefresh = 0;
     for(HostRoleCommand hrc : storedTasks) {
       Assert.assertTrue("DECOMMISSION, Included: h1,h2".equals(hrc.getCommandDetail()));
@@ -6825,11 +6806,6 @@ public class AmbariManagementControllerTest {
     HostRoleCommand command =  storedTasks.get(0);
     Assert.assertEquals(Role.NAMENODE, command.getRole());
     Assert.assertEquals(RoleCommand.CUSTOM_COMMAND, command.getRoleCommand());
-    Map<String, Set<String>> cInfo = execCmd.getClusterHostInfo();
-    Assert.assertTrue(cInfo.containsKey("decom_dn_hosts"));
-    Assert.assertTrue(cInfo.get("decom_dn_hosts").size() == 1);
-    Assert.assertEquals("h1",
-        cInfo.get("all_hosts").toArray()[Integer.parseInt(cInfo.get("decom_dn_hosts").iterator().next())]);
     Assert.assertEquals("DECOMMISSION", execCmd.getHostLevelParams().get("custom_command"));
   }
 


Mime
View raw message