Package org.apache.ivory.entity.v0.cluster

Examples of org.apache.ivory.entity.v0.cluster.Cluster


    }

    @Test
    public void testBundle1() throws Exception {
        Process process = ConfigurationStore.get().get(EntityType.PROCESS, "clicksummary");
        Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER, "corp");
        process.setFrequency(Frequency.fromString("minutes(1)"));
        process.setTimeout(Frequency.fromString("minutes(15)"));
        OozieProcessMapper mapper = new OozieProcessMapper(process);
        Path bundlePath = new Path("/", EntityUtil.getStagingPath(process));
        mapper.map(cluster, bundlePath);
View Full Code Here


        Unmarshaller unmarshaller = type.getUnmarshaller();
        ConfigurationStore store = ConfigurationStore.get();
        store.remove(type, name);
        switch(type) {
            case CLUSTER:
                Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
                cluster.setName(name);
                store.publish(type, cluster);
                break;
               
            case FEED:
                Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
View Full Code Here

    dfsCluster = EmbeddedCluster.newCluster("testCluster", false);
        conf = dfsCluster.getConf();
    hdfsUrl = conf.get("fs.default.name");

    Cluster cluster = (Cluster) EntityType.CLUSTER.getUnmarshaller()
        .unmarshal(this.getClass().getResource(CLUSTER_XML));
    ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(hdfsUrl);

    store.publish(EntityType.CLUSTER, cluster);
View Full Code Here

      process = STORE.get(EntityType.PROCESS, processName);
      long retention = getRetention(process, process.getFrequency()
          .getTimeUnit());
      for (org.apache.ivory.entity.v0.process.Cluster cluster : process
          .getClusters().getClusters()) {
        Cluster currentCluster = STORE.get(EntityType.CLUSTER,
            cluster.getName());
        if(currentCluster.getColo().equals(getCurrentColo())){
          LOG.info("Cleaning up logs for process:" + processName
              + " in  cluster: " + cluster.getName() + " with retention: "+retention);
          delete(currentCluster, process, retention);
        }else{
          LOG.info("Ignoring cleanup for process:" + processName
View Full Code Here

      feed = STORE.get(EntityType.FEED, feedName);
      long retention = getRetention(feed, feed.getFrequency()
          .getTimeUnit());
      for (org.apache.ivory.entity.v0.feed.Cluster cluster : feed
          .getClusters().getClusters()) {
        Cluster currentCluster = STORE.get(EntityType.CLUSTER,
            cluster.getName());
        if(currentCluster.getColo().equals(getCurrentColo())){
          LOG.info("Cleaning up logs for process:" + feedName
              + " in  cluster: " + cluster.getName() + " with retention: "+retention);
          delete(currentCluster, feed, retention);
        }else{
          LOG.info("Ignoring cleanup for process:" + feedName
View Full Code Here

import org.apache.ivory.entity.v0.cluster.Cluster;

@Test
public class ColoClusterRelationTest extends AbstractTestBase{
    private Cluster newCluster(String name, String colo) {
        Cluster cluster = new Cluster();
        cluster.setName(name);
        cluster.setColo(colo);
        return cluster;
    }
View Full Code Here

        return cluster;
    }
   
    @Test
    public void testMapping() throws Exception {
        Cluster cluster1 = newCluster("cluster1", "colo1");
        Cluster cluster2 = newCluster("cluster2", "colo1");
        Cluster cluster3 = newCluster("cluster3", "colo2");
        ConfigurationStore store = ConfigurationStore.get();
        store.publish(EntityType.CLUSTER, cluster1);
        store.publish(EntityType.CLUSTER, cluster2);
        store.publish(EntityType.CLUSTER, cluster3);
       
        ColoClusterRelation relation = ColoClusterRelation.get();
        Set<String> clusters = relation.getClusters("colo1");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(2, clusters.size());
        Assert.assertTrue(clusters.contains(cluster1.getName()));
        Assert.assertTrue(clusters.contains(cluster2.getName()));
       
        clusters = relation.getClusters("colo2");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(1, clusters.size());
        Assert.assertTrue(clusters.contains(cluster3.getName()));

        store.remove(EntityType.CLUSTER, cluster1.getName());
        clusters = relation.getClusters("colo1");
        Assert.assertNotNull(clusters);
        Assert.assertEquals(1, clusters.size());
View Full Code Here

  public void setUp() throws Exception {
      cleanupStore();
      ConfigurationStore store = ConfigurationStore.get();
     
    Unmarshaller unmarshaller = EntityType.CLUSTER.getUnmarshaller();
    Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
        .getResourceAsStream(CLUSTER_XML));
    cluster.setName("testCluster");
    store.publish(EntityType.CLUSTER, cluster);

    cluster = (Cluster) unmarshaller.unmarshal(this.getClass()
        .getResourceAsStream(CLUSTER_XML));
    cluster.setName("backupCluster");
    store.publish(EntityType.CLUSTER, cluster);

    modifiableFeed = (Feed) parser.parseAndValidate(this.getClass()
        .getResourceAsStream(FEED_XML));
  }
View Full Code Here

    }
  }
 
  @Test
  public void testClusterPartitionExp() throws IvoryException {
    Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER,
        "testCluster");
    Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
        "/*/${cluster.colo}"), "/*/" + cluster.getColo());
    Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
        "/*/${cluster.name}/Local"), "/*/" + cluster.getName()+"/Local");
    Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster,
        "/*/${cluster.field1}/Local"), "/*/value1/Local");
  }
 
View Full Code Here

        org.apache.ivory.entity.v0.process.Cluster processCluster = ProcessHelper.getCluster(process, clusterName);
        if (!startDate.before(processCluster.getValidity().getEnd()))
            // start time >= end time
            return null;

        Cluster cluster = configStore.get(EntityType.CLUSTER, processCluster.getName());
        Path bundlePath = new Path(ClusterHelper.getLocation(cluster, "staging"), EntityUtil.getStagingPath(process));
        Process processClone = (Process) process.clone();
        EntityUtil.setStartDate(processClone, clusterName, startDate);

        OozieProcessMapper mapper = new OozieProcessMapper(processClone);
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.v0.cluster.Cluster

Copyright © 2018 www.massapicom. 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.