You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2013/06/05 17:54:04 UTC
svn commit: r1489932 - in
/incubator/ambari/branches/branch-1.4.0/ambari-server/src:
main/java/org/apache/ambari/server/metadata/
test/java/org/apache/ambari/server/controller/
Author: smohanty
Date: Wed Jun 5 15:54:04 2013
New Revision: 1489932
URL: http://svn.apache.org/r1489932
Log:
AMBARI-2286. Add dependency on server to run smoke test after starting yarn. (Oleksandr Diachenko via smohanty)
Modified:
incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java
incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
incubator/ambari/branches/branch-1.4.0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
Modified: incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java?rev=1489932&r1=1489931&r2=1489932&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java (original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java Wed Jun 5 15:54:04 2013
@@ -56,6 +56,7 @@ public class ActionMetadata {
serviceActions.put("hbase" , Arrays.asList(Role.HBASE_SERVICE_CHECK.toString()));
serviceActions.put("mapreduce" , Arrays.asList(Role.MAPREDUCE_SERVICE_CHECK.toString()));
serviceActions.put("mapreduce2" , Arrays.asList(Role.MAPREDUCE2_SERVICE_CHECK.toString()));
+ serviceActions.put("yarn" , Arrays.asList(Role.YARN_SERVICE_CHECK.toString()));
serviceActions.put("zookeeper" , Arrays.asList(Role.ZOOKEEPER_QUORUM_SERVICE_CHECK.toString()));
serviceActions.put("hive" , Arrays.asList(Role.HIVE_SERVICE_CHECK.toString()));
serviceActions.put("hcat" , Arrays.asList(Role.HCAT_SERVICE_CHECK.toString()));
@@ -72,6 +73,8 @@ public class ActionMetadata {
Role.MAPREDUCE_SERVICE_CHECK.toString());
serviceCheckActions.put("mapreduce2",
Role.MAPREDUCE2_SERVICE_CHECK.toString());
+ serviceCheckActions.put("yarn",
+ Role.YARN_SERVICE_CHECK.toString());
serviceCheckActions.put("zookeeper",
Role.ZOOKEEPER_QUORUM_SERVICE_CHECK.toString());
serviceCheckActions.put("hive", Role.HIVE_SERVICE_CHECK.toString());
Modified: incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java?rev=1489932&r1=1489931&r2=1489932&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java (original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java Wed Jun 5 15:54:04 2013
@@ -169,6 +169,10 @@ public class RoleCommandOrder {
Role.RESOURCEMANAGER, RoleCommand.START);
addDependency(Role.MAPREDUCE2_SERVICE_CHECK, RoleCommand.EXECUTE,
Role.HISTORYSERVER, RoleCommand.START);
+ addDependency(Role.YARN_SERVICE_CHECK, RoleCommand.EXECUTE,
+ Role.NODEMANAGER, RoleCommand.START);
+ addDependency(Role.YARN_SERVICE_CHECK, RoleCommand.EXECUTE,
+ Role.RESOURCEMANAGER, RoleCommand.START);
addDependency(Role.RESOURCEMANAGER_SERVICE_CHECK, RoleCommand.EXECUTE,
Role.RESOURCEMANAGER, RoleCommand.START);
addDependency(Role.OOZIE_SERVICE_CHECK, RoleCommand.EXECUTE,
Modified: incubator/ambari/branches/branch-1.4.0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java?rev=1489932&r1=1489931&r2=1489932&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java (original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java Wed Jun 5 15:54:04 2013
@@ -1738,6 +1738,7 @@ public class AmbariManagementControllerI
final String CLUSTER_NAME = "c1";
final String HDFS_SERVICE_CHECK_ROLE = "HDFS_SERVICE_CHECK";
final String MAPREDUCE2_SERVICE_CHECK_ROLE = "MAPREDUCE2_SERVICE_CHECK";
+ final String YARN_SERVICE_CHECK_ROLE = "YARN_SERVICE_CHECK";
Map<String,String> mapRequestProps = Collections.<String,String>emptyMap();
Injector injector = Guice.createInjector(new AbstractModule() {
@@ -1773,6 +1774,7 @@ public class AmbariManagementControllerI
Set<ServiceRequest> serviceRequests = new HashSet<ServiceRequest>();
serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "HDFS", null, null));
serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "MAPREDUCE2", null, null));
+ serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "YARN", null, null));
amc.createServices(serviceRequests);
@@ -1781,6 +1783,8 @@ public class AmbariManagementControllerI
serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "SECONDARY_NAMENODE", null, null));
serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "DATANODE", null, null));
serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "MAPREDUCE2", "HISTORYSERVER", null, null));
+ serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "YARN", "RESOURCEMANAGER", null, null));
+ serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "YARN", "NODEMANAGER", null, null));
amc.createComponents(serviceComponentRequests);
@@ -1794,6 +1798,8 @@ public class AmbariManagementControllerI
componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, null, "NAMENODE", HOST1, null, null));
componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, null, "SECONDARY_NAMENODE", HOST1, null, null));
componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, null, "HISTORYSERVER", HOST1, null, null));
+ componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, null, "RESOURCEMANAGER", HOST1, null, null));
+ componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, null, "NODEMANAGER", HOST1, null, null));
amc.createHostComponents(componentHostRequests);
@@ -1801,6 +1807,8 @@ public class AmbariManagementControllerI
serviceRequests.clear();
serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "HDFS", null, State.INSTALLED.name()));
serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "MAPREDUCE2", null, State.INSTALLED.name()));
+ serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "YARN", null, State.INSTALLED.name()));
+
amc.updateServices(serviceRequests, mapRequestProps, true, false);
Cluster cluster = clusters.getCluster(CLUSTER_NAME);
@@ -1823,6 +1831,8 @@ public class AmbariManagementControllerI
serviceRequests.clear();
serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "HDFS", null, State.STARTED.name()));
serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "MAPREDUCE2", null, State.STARTED.name()));
+ serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "YARN", null, State.STARTED.name()));
+
RequestStatusResponse response = amc.updateServices(serviceRequests,
mapRequestProps, true, false);
@@ -1834,6 +1844,9 @@ public class AmbariManagementControllerI
//Ensure that smoke test task was created for MAPREDUCE2
assertEquals(1, mapreduce2SmokeTasks.size());
+ Collection<?> yarnSmokeTasks = CollectionUtils.select(response.getTasks(), new RolePredicate(YARN_SERVICE_CHECK_ROLE));
+ //Ensure that smoke test task was created for YARN
+ assertEquals(1, yarnSmokeTasks.size());
}
private class RolePredicate implements Predicate {