Package org.apache.ambari.server.state

Examples of org.apache.ambari.server.state.Service.persist()


  @Test
  public void testDeleteService() throws Exception {
    c1.addService("MAPREDUCE").persist();

    Service hdfs = c1.addService("HDFS");
    hdfs.persist();
    ServiceComponent nameNode = hdfs.addServiceComponent("NAMENODE");
    nameNode.persist();


    assertEquals(2, c1.getServices().size());
View Full Code Here


    c1.addService(s1);
    c1.addService(s2);

    s1.persist();
    s2.persist();

    Service s3 = serviceFactory.createNew(c1, "MAPREDUCE");

    try {
      c1.addService(s3);
View Full Code Here

    // TODO write unit tests
    // public List<ServiceComponentHost> getServiceComponentHosts(String hostname);

    Service s = serviceFactory.createNew(c1, "HDFS");
    c1.addService(s);
    s.persist();
    ServiceComponent sc = serviceComponentFactory.createNew(s, "NAMENODE");
    s.addServiceComponent(sc);
    sc.persist();
    ServiceComponentHost sch =
        serviceComponentHostFactory.createNew(sc, "h1", false);
View Full Code Here

  @Test
  public void testDeleteService() throws Exception {
    c1.addService("MAPREDUCE").persist();

    Service hdfs = c1.addService("HDFS");
    hdfs.persist();
    ServiceComponent nameNode = hdfs.addServiceComponent("NAMENODE");
    nameNode.persist();


    assertEquals(2, c1.getServices().size());
View Full Code Here

    // host config override
    host1.addDesiredConfig(cluster.getClusterId(), true, "_test", config2);
    host1.persist();

    Service hdfs = cluster.addService("HDFS");
    hdfs.persist();
   
    // service config
    hdfs.updateDesiredConfigs(new HashMap<String,Config>() {{ put("t1", config1); }});
    hdfs.persist();
View Full Code Here

    Service hdfs = cluster.addService("HDFS");
    hdfs.persist();
   
    // service config
    hdfs.updateDesiredConfigs(new HashMap<String,Config>() {{ put("t1", config1); }});
    hdfs.persist();

    Assert.assertNotNull(injector.getInstance(ClusterServiceDAO.class).findByClusterAndServiceNames(c1, "HDFS"));

    ServiceComponent nameNode = hdfs.addServiceComponent("NAMENODE");
    nameNode.persist();
View Full Code Here

    service = serviceFactory.createNew(cluster, "HBASE");
    cluster.addService(service);
    service.persist();
    service = cluster.getService("HBASE");
    service.addServiceComponent(HBASE_MASTER).persist();
    service.persist();
    for (String hostname : hostnames) {
      service.getServiceComponent(HBASE_MASTER).addServiceComponentHost(hostname).persist();
      if (hostname.equals("127.0.0.1")) {
        serviceComponentHost = service.getServiceComponent(HBASE_MASTER).getServiceComponentHost(hostname);
      }
View Full Code Here

    Set<String> hostNames = new HashSet<String>(){{
      add(DummyHostname1);
    }};
    clusters.mapHostsToCluster(hostNames, DummyCluster);
    Service hdfs = cluster.addService(HDFS);
    hdfs.persist();
    hdfs.addServiceComponent(DATANODE).persist();
    hdfs.getServiceComponent(DATANODE).addServiceComponentHost(DummyHostname1).persist();
    hdfs.addServiceComponent(NAMENODE).persist();
    hdfs.getServiceComponent(NAMENODE).addServiceComponentHost(DummyHostname1).persist();
    hdfs.addServiceComponent(SECONDARY_NAMENODE).persist();
View Full Code Here

    Set<String> hostNames = new HashSet<String>() {{
      add(DummyHostname1);
    }};
    clusters.mapHostsToCluster(hostNames, DummyCluster);
    Service hdfs = cluster.addService(HDFS);
    hdfs.persist();
    hdfs.addServiceComponent(DATANODE).persist();
    hdfs.getServiceComponent(DATANODE).addServiceComponentHost(DummyHostname1).persist();

    ActionQueue aq = new ActionQueue();
    HeartBeatHandler handler = getHeartBeatHandler(am, aq);
View Full Code Here

    Set<String> hostNames = new HashSet<String>() {{
      add(DummyHostname1);
    }};
    clusters.mapHostsToCluster(hostNames, DummyCluster);
    Service hdfs = cluster.addService(HDFS);
    hdfs.persist();
    hdfs.addServiceComponent(DATANODE).persist();
    hdfs.getServiceComponent(DATANODE).addServiceComponentHost(DummyHostname1).persist();

    ActionQueue aq = new ActionQueue();
    HeartBeatHandler handler = getHeartBeatHandler(am, aq);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.