Package org.apache.falcon.entity.v0.cluster

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


        storeEntity(EntityType.FEED, "imp-click-join2");
    }

    private void prepare(Process process) throws IOException, FalconException {
        FileSystem fs = dfsCluster.getFileSystem();
        Cluster clusterEntity = ConfigurationStore.get().get(EntityType.CLUSTER, "testCluster");
        Path staging = EntityUtil.getNewStagingPath(clusterEntity, process);
        fs.mkdirs(staging);
        fs.create(new Path(staging, "workflow.xml")).close();
        fs.create(new Path(staging, "checksums")).close();
    }
View Full Code Here


    @Test
    public void testWorkflowUpdate() throws IOException, FalconException {
        FileSystem fs = dfsCluster.getFileSystem();
        Process process = processParser.parseAndValidate(this.getClass().getResourceAsStream(PROCESS_XML));
        String cluster = "testCluster";
        Cluster clusterEntity = ConfigurationStore.get().get(EntityType.CLUSTER, cluster);
        Path staging = EntityUtil.getNewStagingPath(clusterEntity, process);
        fs.mkdirs(staging);
        fs.create(new Path(staging, "workflow.xml")).close();
        fs.create(new Path(staging, EntityUtil.SUCCEEDED_FILE_NAME)).close();
View Full Code Here

        Assert.assertTrue(UpdateHelper.isEntityUpdated(oldTableFeed, newTableFeed, cluster));

        inputStream = getClass().getResourceAsStream("/config/process/process-table.xml");
        Process oldProcess = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(inputStream);
        FileSystem fs = dfsCluster.getFileSystem();
        Cluster clusterEntity = ConfigurationStore.get().get(EntityType.CLUSTER, "testCluster");
        Path staging = EntityUtil.getNewStagingPath(clusterEntity, oldProcess);
        fs.mkdirs(staging);
        fs.create(new Path(staging, "workflow.xml")).close();
        fs.create(new Path(staging, "checksums")).close();
        Process newProcess = (Process) oldProcess.copy();
View Full Code Here

            System.out.println(GraphUtils.edgeString(edge));
        }
    }

    private static Cluster buildCluster(String name, String colo, String tags) {
        Cluster cluster = new Cluster();
        cluster.setName(name);
        cluster.setColo(colo);
        cluster.setTags(tags);

        Interfaces interfaces = new Interfaces();
        cluster.setInterfaces(interfaces);

        Interface storage = new Interface();
        storage.setEndpoint("jail://global:00");
        storage.setType(Interfacetype.WRITE);
        cluster.getInterfaces().getInterfaces().add(storage);

        return cluster;
    }
View Full Code Here

    public void onAdd(Entity entity, boolean ignoreFailure) throws FalconException {
        if (entity.getEntityType() != EntityType.CLUSTER) {
            return;
        }

        Cluster cluster = (Cluster) entity;
        if (!EntityUtil.responsibleFor(cluster.getColo())) {
            return;
        }

        try {
            addLibsTo(cluster);
View Full Code Here

    @Override
    public void onChange(Entity oldEntity, Entity newEntity) throws FalconException {
        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

    }

    @Override
    public void afterDelete(Entity entity, String clusterName) throws FalconException {
        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);
View Full Code Here

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

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

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

            }

            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 (FalconException e) {
            throw FalconWebException.newException(e, Response.Status.BAD_REQUEST);
        }
View Full Code Here

        dfsCluster = EmbeddedCluster.newCluster("testCluster", false);
        Configuration conf = dfsCluster.getConf();
        String 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

TOP

Related Classes of org.apache.falcon.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.