You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mp...@apache.org on 2014/06/27 00:26:29 UTC

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

Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 7282bcd48 -> 67bd561f6


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/67bd561f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/67bd561f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/67bd561f

Branch: refs/heads/branch-1.6.1
Commit: 67bd561f63b519b3915e19d7c18f96985795c42a
Parents: 7282bcd
Author: Myroslav Papirkovskyy <mp...@hortonworks.com>
Authored: Fri Jun 27 01:20:29 2014 +0300
Committer: Myroslav Papirkovskyy <mp...@hortonworks.com>
Committed: Fri Jun 27 01:25:55 2014 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/67bd561f/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/67bd561f/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 4b7a0a4..e619e1f 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"));
   }