Package org.apache.falcon.entity.v0.process

Examples of org.apache.falcon.entity.v0.process.Process


        parser.parseAndValidate(process.toString());
    }

    @Test(expectedExceptions = ValidationException.class)
    public void testInvalidLateInputs() throws Exception {
        Process process = parser
                .parseAndValidate((ProcessEntityParserTest.class
                        .getResourceAsStream(PROCESS_XML)));
        process.getLateProcess().getLateInputs().get(0).setInput("invalidInput");
        parser.parseAndValidate(process.toString());
    }
View Full Code Here


        parser.parseAndValidate(process.toString());
    }

    @Test(expectedExceptions = FalconException.class)
    public void testInvalidProcessName() throws Exception {
        Process process = parser
                .parseAndValidate((ProcessEntityParserTest.class
                        .getResourceAsStream(PROCESS_XML)));
        process.setName("name_with_underscore");
        parser.parseAndValidate(process.toString());
    }
View Full Code Here

        parser.parseAndValidate(process.toString());
    }

    @Test
    public void testOozieFutureExpression() throws Exception {
        Process process = parser
                .parseAndValidate((ProcessEntityParserTest.class
                        .getResourceAsStream(PROCESS_XML)));
        process.getInputs().getInputs().get(0).setStart("future(1,2)");
        parser.parseAndValidate(process.toString());
    }
View Full Code Here

        parser.parseAndValidate(process.toString());
    }

    @Test
    public void testOozieLatestExpression() throws Exception {
        Process process = parser
                .parseAndValidate((ProcessEntityParserTest.class
                        .getResourceAsStream(PROCESS_XML)));
        process.getInputs().getInputs().get(0).setStart("latest(-1)");
        parser.parseAndValidate(process.toString());
    }
View Full Code Here

        parser.parseAndValidate(process.toString());
    }

    @Test(expectedExceptions = ValidationException.class)
    public void testDuplicateClusterName() throws Exception {
        Process process = parser
                .parse((ProcessEntityParserTest.class
                        .getResourceAsStream(PROCESS_XML)));
        process.getClusters().getClusters().add(1, process.getClusters().getClusters().get(0));
        parser.validate(process);
    }
View Full Code Here

        Feed outFeed = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
                this.getClass().getResource("/config/feed/hive-table-feed-out.xml"));
        getStore().publish(EntityType.FEED, outFeed);

        Process process = parser.parse(
                ProcessEntityParserTest.class.getResourceAsStream("/config/process/process-table.xml"));
        Input input = process.getInputs().getInputs().get(0);
        Assert.assertFalse(input.isOptional());
        parser.validate(process);

        // Test Optional Inputs For Table Storage
        try {
View Full Code Here

        }
    }

    @Test(expectedExceptions = ValidationException.class)
    public void testValidateInputPartitionForTable() throws Exception {
        Process process = parser.parse(
                ProcessEntityParserTest.class.getResourceAsStream("/config/process/process-table.xml"));
        if (process.getInputs() != null) {
            for (Input input : process.getInputs().getInputs()) {
                input.setPartition("region=usa");
            }
        }

        parser.validate(process);
View Full Code Here

        if (entity.getEntityType() != EntityType.PROCESS) {
            return false;
        }

        try {
            Process process = (Process) entity;
            org.apache.falcon.entity.v0.cluster.Cluster clusterEntity =
                    ConfigurationStore.get().get(EntityType.CLUSTER, cluster);
            Path bundlePath = EntityUtil.getLastCommittedStagingPath(clusterEntity, process);
            if (bundlePath == null) {
                return true;
            }

            Path checksum = new Path(bundlePath, EntityUtil.PROCESS_CHECKSUM_FILE);
            Configuration conf = ClusterHelper.getConfiguration(clusterEntity);
            FileSystem fs = HadoopClientFactory.get().createProxiedFileSystem(conf);
            if (!fs.exists(checksum)) {
                //Update if there is no checksum file(for migration)
                return true;
            }
            Map<String, String> checksums = readChecksums(fs, checksum);

            //Get checksum from user wf/lib
            Map<String, String> wfPaths = checksumAndCopy(fs, new Path(process.getWorkflow().getPath()), null);
            if (process.getWorkflow().getLib() != null) {
                wfPaths.putAll(checksumAndCopy(fs, new Path(process.getWorkflow().getLib()), null));
            }

            //Update if the user wf/lib is updated i.e., if checksums are different
            return !wfPaths.equals(checksums);
        } catch (IOException e) {
View Full Code Here

        throws FalconException {
        if (oldEntity.getEntityType() == EntityType.FEED && affectedEntity.getEntityType() == EntityType.PROCESS) {

            Feed oldFeed = (Feed) oldEntity;
            Feed newFeed = (Feed) newEntity;
            Process affectedProcess = (Process) affectedEntity;

            //check if affectedProcess is defined for this cluster
            if (ProcessHelper.getCluster(affectedProcess, cluster) == null) {
                LOG.debug("Process " + affectedProcess.getName() + " is not defined for cluster " + cluster);
                return false;
            }

            if (!oldFeed.getFrequency().equals(newFeed.getFrequency())) {
                LOG.debug(oldFeed.toShortString() + ": Frequency has changed. Updating...");
View Full Code Here

        storeEntity(EntityType.FEED, "impressionFeed");
        storeEntity(EntityType.FEED, "clicksFeed");
        storeEntity(EntityType.FEED, "imp-click-join1");
        storeEntity(EntityType.FEED, "imp-click-join2");
        storeEntity(EntityType.PROCESS, "sample");
        Process process = ConfigurationStore.get().get(EntityType.PROCESS, "sample");
        Process otherProcess = (Process) process.copy();
        otherProcess.setName("sample2");
        otherProcess.setFrequency(new Frequency("days(1)"));
        ConfigurationStore.get().remove(EntityType.PROCESS,
                otherProcess.getName());
        ConfigurationStore.get().publish(EntityType.PROCESS, otherProcess);

        fs.mkdirs(instanceLogPath);
        fs.mkdirs(instanceLogPath1);
        fs.mkdirs(instanceLogPath2);
View Full Code Here

TOP

Related Classes of org.apache.falcon.entity.v0.process.Process

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.