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

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


    @Override
    public void onChange(Entity oldEntity, Entity newEntity) throws IvoryException {
        if (oldEntity.getEntityType() != EntityType.CLUSTER)
            return;
        Cluster oldCluster = (Cluster) oldEntity;
        Cluster newCluster = (Cluster) newEntity;
        if (!ClusterHelper.getInterface(oldCluster, Interfacetype.WRITE).getEndpoint()
                .equals(ClusterHelper.getInterface(newCluster, Interfacetype.WRITE).getEndpoint())
                || !ClusterHelper.getInterface(oldCluster, Interfacetype.WORKFLOW).getEndpoint()
                        .equals(ClusterHelper.getInterface(newCluster, Interfacetype.WORKFLOW).getEndpoint())) {
            addLibsTo(newCluster);
View Full Code Here


                return getAllColos();

            Set<String> clusters = EntityUtil.getClustersDefined(entity);
            Set<String> colos = new HashSet<String>();
            for (String cluster : clusters) {
                Cluster clusterEntity = EntityUtil.getEntity(EntityType.CLUSTER, cluster);
                colos.add(clusterEntity.getColo());
            }
            return colos;
        } catch (IvoryException e) {
            throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);
        }
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);
                ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));
                store.publish(type, cluster);
                break;

            case FEED:
View Full Code Here

    }

    @Override
    public void afterDelete(Entity entity, String clusterName) throws IvoryException {
        try {
            Cluster cluster = EntityUtil.getEntity(EntityType.CLUSTER, clusterName);
            Path entityPath = new Path(ClusterHelper.getLocation(cluster, "staging"), EntityUtil.getStagingPath(entity)).getParent();
            LOG.info("Deleting entity path " + entityPath + " on cluster " + clusterName);
           
            Configuration conf = ClusterHelper.getConfiguration(cluster);
            FileSystem fs = FileSystem.get(conf);
View Full Code Here

  private static final Logger LOG = Logger.getLogger(LogProvider.class);

  public Instance populateLogUrls(Entity entity, Instance instance,
      String runId) throws IvoryException {

    Cluster clusterObj = (Cluster) ConfigurationStore.get().get(
        EntityType.CLUSTER, instance.cluster);
    String resolvedRunId = "-";
    try {
      FileSystem fs = FileSystem.get(
          new Path(ClusterHelper.getStorageUrl(clusterObj)).toUri(),
View Full Code Here

    @Override
    public void onAdd(Entity entity) {
        if (entity.getEntityType() != EntityType.CLUSTER)
            return;

        Cluster cluster = (Cluster) entity;
        coloClusterMap.putIfAbsent(cluster.getColo(), new HashSet<String>());
        coloClusterMap.get(cluster.getColo()).add(cluster.getName());
    }
View Full Code Here

    @Override
    public void onRemove(Entity entity) {
        if (entity.getEntityType() != EntityType.CLUSTER)
            return;

        Cluster cluster = (Cluster) entity;
        coloClusterMap.get(cluster.getColo()).remove(cluster.getName());
        if (coloClusterMap.get(cluster.getColo()).isEmpty())
            coloClusterMap.remove(cluster.getColo());
    }
View Full Code Here

        this.server.start();

        if (System.getProperty("ivory.test.hadoop.embedded", "true").equals("true")) {
            CLUSTER_FILE_TEMPLATE = "target/cluster-template.xml";
            this.cluster = EmbeddedCluster.newCluster("##cluster##", true);
            Cluster clusterEntity = this.cluster.getCluster();
            FileOutputStream out = new FileOutputStream(CLUSTER_FILE_TEMPLATE);
            marshaller.marshal(clusterEntity, out);
            out.close();
        } else {
            Map<String, String> overlay = new HashMap<String, String>();
View Full Code Here

    @BeforeMethod
    public void setUp() throws Exception {
        super.setup();
       
        ConfigurationStore store = ConfigurationStore.get();
        Cluster cluster = store.get(EntityType.CLUSTER, "corp");
        ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(hdfsUrl);

        Process process = store.get(EntityType.PROCESS, "clicksummary");
        Path wfpath = new Path(process.getWorkflow().getPath());
        assert new Path(hdfsUrl).getFileSystem(new Configuration()).mkdirs(wfpath);
View Full Code Here

    }
   
    @Test
    public void testBundle() throws Exception {
        Process process = ConfigurationStore.get().get(EntityType.PROCESS, "clicksummary");
        Cluster cluster = ConfigurationStore.get().get(EntityType.CLUSTER, "corp");
        OozieProcessMapper mapper = new OozieProcessMapper(process);
        Path bundlePath = new Path("/", EntityUtil.getStagingPath(process));
        mapper.map(cluster, bundlePath);
       
        FileSystem fs = new Path(hdfsUrl).getFileSystem(new Configuration());
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.