ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] ambari git commit: Revert "AMBARI-20014 More than one version of jetty jars found in Ambari rpm (dsen)"
Date Tue, 21 Feb 2017 10:24:53 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2a38ff199 -> 1e56124be


Revert "AMBARI-20014 More than one version of jetty jars found in Ambari rpm (dsen)"

This reverts commit 48ea5380806280547056ce409a6a35019beb2514.


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

Branch: refs/heads/branch-2.5
Commit: 6496e25871a4f7a41791f44420d4fb833f0bbb4c
Parents: 2a38ff1
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Feb 21 12:20:26 2017 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Feb 21 12:20:26 2017 +0200

----------------------------------------------------------------------
 .../server/state/cluster/ClusterImpl.java       |   2 -
 .../AmbariManagementControllerTest.java         | 121 +++++++++----------
 2 files changed, 59 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6496e258/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index db6d8f8..0cd2503 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2123,8 +2123,6 @@ public class ClusterImpl implements Cluster {
     try {
       refresh();
       deleteAllServices();
-
-      refresh(); // update one-to-many clusterServiceEntities
       removeEntities();
       allConfigs.clear();
     } finally {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6496e258/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 c40ff64..37ae2bf 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
@@ -151,7 +151,6 @@ import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartedEve
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStoppedEvent;
 import org.apache.ambari.server.topology.TopologyManager;
-import org.apache.ambari.server.utils.EventBusSynchronizer;
 import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.easymock.Capture;
@@ -198,6 +197,7 @@ public class AmbariManagementControllerTest {
   private static final String FAKE_SERVICE_NAME = "FAKENAGIOS";
   private static final int STACK_VERSIONS_CNT = 16;
   private static final int REPOS_CNT = 3;
+  private static final int STACKS_CNT = 3;
   private static final int STACK_PROPERTIES_CNT = 103;
   private static final int STACK_COMPONENTS_CNT = 4;
   private static final int OS_CNT = 2;
@@ -256,8 +256,6 @@ public class AmbariManagementControllerTest {
 
   @Before
   public void setup() throws Exception {
-    EventBusSynchronizer.synchronizeAmbariEventPublisher(injector);
-
     entityManager = injector.getProvider(EntityManager.class).get();
     actionDB = injector.getInstance(ActionDBAccessor.class);
     serviceFactory = injector.getInstance(ServiceFactory.class);
@@ -7235,14 +7233,10 @@ public class AmbariManagementControllerTest {
   @Test
   public void testGetStacks() throws Exception {
 
-    HashSet<String> availableStacks = new HashSet<>();
-    for (StackInfo stackInfo: ambariMetaInfo.getStacks()){
-      availableStacks.add(stackInfo.getName());
-    }
 
     StackRequest request = new StackRequest(null);
     Set<StackResponse> responses = controller.getStacks(Collections.singleton(request));
-    Assert.assertEquals(availableStacks.size(), responses.size());
+    Assert.assertEquals(STACKS_CNT, responses.size());
 
     StackRequest requestWithParams = new StackRequest(STACK_NAME);
     Set<StackResponse> responsesWithParams = controller.getStacks(Collections.singleton(requestWithParams));
@@ -9260,82 +9254,85 @@ public class AmbariManagementControllerTest {
     String HOST1 = getUniqueName();
     String HOST2 = getUniqueName();
 
-    Clusters clusters = injector.getInstance(Clusters.class);
+    try {
+      Clusters clusters = injector.getInstance(Clusters.class);
 
-    clusters.addHost(HOST1);
-    Host host = clusters.getHost(HOST1);
-    setOsFamily(host, "redhat", "6.3");
-    clusters.getHost(HOST1).setState(HostState.HEALTHY);
+      clusters.addHost(HOST1);
+      Host host = clusters.getHost(HOST1);
+      setOsFamily(host, "redhat", "6.3");
+      clusters.getHost(HOST1).setState(HostState.HEALTHY);
 
-    clusters.addHost(HOST2);
-    host = clusters.getHost(HOST2);
-    setOsFamily(host, "redhat", "6.3");
+      clusters.addHost(HOST2);
+      host = clusters.getHost(HOST2);
+      setOsFamily(host, "redhat", "6.3");
       clusters.getHost(HOST1).setState(HostState.HEALTHY);
 
-    AmbariManagementController amc = injector.getInstance(AmbariManagementController.class);
+      AmbariManagementController amc = injector.getInstance(AmbariManagementController.class);
 
-    ClusterRequest cr = new ClusterRequest(null, CLUSTER_NAME, STACK_ID, null);
-    amc.createCluster(cr);
+      ClusterRequest cr = new ClusterRequest(null, CLUSTER_NAME, STACK_ID, null);
+      amc.createCluster(cr);
 
-    Long CLUSTER_ID = clusters.getCluster(CLUSTER_NAME).getClusterId();
+      Long CLUSTER_ID = clusters.getCluster(CLUSTER_NAME).getClusterId();
 
-    ConfigurationRequest configRequest = new ConfigurationRequest(CLUSTER_NAME, "global",
"version1",
-        new HashMap<String, String>() {{ put("a", "b"); }}, null);
-    cr.setDesiredConfig(Collections.singletonList(configRequest));
-    cr.setClusterId(CLUSTER_ID);
-    amc.updateClusters(Collections.singleton(cr), new HashMap<String, String>());
+      ConfigurationRequest configRequest = new ConfigurationRequest(CLUSTER_NAME, "global",
"version1",
+          new HashMap<String, String>() {{ put("a", "b"); }}, null);
+      cr.setDesiredConfig(Collections.singletonList(configRequest));
+      cr.setClusterId(CLUSTER_ID);
+      amc.updateClusters(Collections.singleton(cr), new HashMap<String, String>());
 
-    // add some hosts
-    Set<HostRequest> hrs = new HashSet<HostRequest>();
-    hrs.add(new HostRequest(HOST1, CLUSTER_NAME, null));
-    HostResourceProviderTest.createHosts(amc, hrs);
+      // add some hosts
+      Set<HostRequest> hrs = new HashSet<HostRequest>();
+      hrs.add(new HostRequest(HOST1, CLUSTER_NAME, null));
+      HostResourceProviderTest.createHosts(amc, hrs);
 
-    Set<ServiceRequest> serviceRequests = new HashSet<ServiceRequest>();
-    serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "HDFS", null));
-    serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "MAPREDUCE2", null));
-    serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "YARN", null));
-
-    ServiceResourceProviderTest.createServices(amc, serviceRequests);
+      Set<ServiceRequest> serviceRequests = new HashSet<ServiceRequest>();
+      serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "HDFS", null));
+      serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "MAPREDUCE2", null));
+      serviceRequests.add(new ServiceRequest(CLUSTER_NAME, "YARN", null));
 
-    Set<ServiceComponentRequest> serviceComponentRequests = new HashSet<ServiceComponentRequest>();
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "NAMENODE",
null));
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "SECONDARY_NAMENODE",
null));
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "DATANODE",
null));
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "MAPREDUCE2",
"HISTORYSERVER", null));
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "YARN", "RESOURCEMANAGER",
null));
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "YARN", "NODEMANAGER",
null));
-    serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "HDFS_CLIENT",
null));
+      ServiceResourceProviderTest.createServices(amc, serviceRequests);
 
-    ComponentResourceProviderTest.createComponents(amc, serviceComponentRequests);
+      Set<ServiceComponentRequest> serviceComponentRequests = new HashSet<ServiceComponentRequest>();
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "NAMENODE",
null));
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "SECONDARY_NAMENODE",
null));
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "DATANODE",
null));
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "MAPREDUCE2",
"HISTORYSERVER", null));
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "YARN", "RESOURCEMANAGER",
null));
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "YARN", "NODEMANAGER",
null));
+      serviceComponentRequests.add(new ServiceComponentRequest(CLUSTER_NAME, "HDFS", "HDFS_CLIENT",
null));
 
-    Set<ServiceComponentHostRequest> componentHostRequests = new HashSet<ServiceComponentHostRequest>();
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "DATANODE",
HOST1, null));
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "NAMENODE",
HOST1, null));
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "SECONDARY_NAMENODE",
HOST1, null));
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "MAPREDUCE2",
"HISTORYSERVER", HOST1, null));
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "YARN", "RESOURCEMANAGER",
HOST1, null));
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "YARN", "NODEMANAGER",
HOST1, null));
-    componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "HDFS_CLIENT",
HOST1, null));
+      ComponentResourceProviderTest.createComponents(amc, serviceComponentRequests);
 
-    amc.createHostComponents(componentHostRequests);
+      Set<ServiceComponentHostRequest> componentHostRequests = new HashSet<ServiceComponentHostRequest>();
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "DATANODE",
HOST1, null));
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "NAMENODE",
HOST1, null));
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "SECONDARY_NAMENODE",
HOST1, null));
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "MAPREDUCE2",
"HISTORYSERVER", HOST1, null));
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "YARN", "RESOURCEMANAGER",
HOST1, null));
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "YARN", "NODEMANAGER",
HOST1, null));
+      componentHostRequests.add(new ServiceComponentHostRequest(CLUSTER_NAME, "HDFS", "HDFS_CLIENT",
HOST1, null));
 
-    RequestResourceFilter resourceFilter = new RequestResourceFilter("HDFS", null, null);
-    ExecuteActionRequest ar = new ExecuteActionRequest(CLUSTER_NAME, Role.HDFS_SERVICE_CHECK.name(),
null, false);
-    ar.getResourceFilters().add(resourceFilter);
-    amc.createAction(ar, null);
+      amc.createHostComponents(componentHostRequests);
 
+      RequestResourceFilter resourceFilter = new RequestResourceFilter("HDFS", null, null);
+      ExecuteActionRequest ar = new ExecuteActionRequest(CLUSTER_NAME, Role.HDFS_SERVICE_CHECK.name(),
null, false);
+      ar.getResourceFilters().add(resourceFilter);
+      amc.createAction(ar, null);
 
-    // change mind, delete the cluster
-    amc.deleteCluster(cr);
+      // change mind, delete the cluster
+      amc.deleteCluster(cr);
 
       assertNotNull(clusters.getHost(HOST1));
       assertNotNull(clusters.getHost(HOST2));
 
-    HostDAO dao = injector.getInstance(HostDAO.class);
+      HostDAO dao = injector.getInstance(HostDAO.class);
 
-    assertNotNull(dao.findByName(HOST1));
-    assertNotNull(dao.findByName(HOST2));
+      assertNotNull(dao.findByName(HOST1));
+      assertNotNull(dao.findByName(HOST2));
 
+    } finally {
+//      injector.getInstance(PersistService.class).stop();
+    }
   }
 
   @Test


Mime
View raw message