Package org.apache.falcon.entity.v0

Examples of org.apache.falcon.entity.v0.EntityType


        ConfigurationStore.get().remove(EntityType.PROCESS, "sample");
        ConfigurationStore.get().remove(EntityType.PROCESS, "sample2");
        storeEntity(EntityType.FEED, "impressionFeed");
        storeEntity(EntityType.FEED, "imp-click-join1");
        storeEntity(EntityType.FEED, "imp-click-join2");
        Feed feed = parser.parseAndValidate(this.getClass()
                .getResourceAsStream(FEED_XML));
        ConfigurationStore.get().publish(EntityType.FEED, feed);
        Process process = processParser.parseAndValidate(this.getClass()
                .getResourceAsStream(PROCESS1_XML));
        ConfigurationStore.get().publish(EntityType.PROCESS, process);
View Full Code Here


        parser.validate(process);
    }

    @Test
    public void testProcessForTableStorage() throws Exception {
        Feed inFeed = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
                this.getClass().getResource("/config/feed/hive-table-feed.xml"));
        getStore().publish(EntityType.FEED, inFeed);

        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"));
View Full Code Here

*/
public class TestWorkflowNameBuilder {

    @Test
    public void getTagTest() {
        Feed feed = new Feed();
        feed.setName("raw-logs");

        WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
        Tag tag = builder.getWorkflowTag("FALCON_FEED_RETENTION_raw-logs");
        Assert.assertEquals(tag, Tag.RETENTION);

View Full Code Here

    }

    @Test
    public void getSuffixesTest() {
        Feed feed = new Feed();
        feed.setName("raw-logs");
        WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);

        String suffixes = builder
                .getWorkflowSuffixes("FALCON_FEED_REPLICATION_raw-logs_corp-1");
        Assert.assertEquals(suffixes, "_corp-1");
View Full Code Here

        Assert.assertEquals(suffixes, "");
    }

    @Test
    public void workflowNameTest() {
        Feed feed = new Feed();
        feed.setName("raw-logs");

        WorkflowNameBuilder<Feed> builder = new WorkflowNameBuilder<Feed>(feed);
        Assert.assertEquals(builder.getWorkflowName().toString(),
                "FALCON_FEED_raw-logs");
View Full Code Here

        InputStream stream = new FileInputStream(filePath);
        FeedEntityParser parser = (FeedEntityParser) EntityParserFactory.getParser(EntityType.FEED);
        Feed feed = parser.parse(stream);
        Assert.assertNotNull(feed);

        final LateArrival lateArrival = new LateArrival();
        lateArrival.setCutOff(new Frequency("4", Frequency.TimeUnit.hours));
        feed.setLateArrival(lateArrival);

        StringWriter stringWriter = new StringWriter();
        Marshaller marshaller = EntityType.FEED.getMarshaller();
        marshaller.marshal(feed, stringWriter);
View Full Code Here

public class TestLateRerunHandler {

    @Test
    public void testFeedCutOff() throws FalconException {
        Feed feed = new Feed();
        LateArrival lateArrival = new LateArrival();
        lateArrival.setCutOff(Frequency.fromString("days(1)"));
        feed.setLateArrival(lateArrival);
        String nm = "2013-10-01T12:00Z";
        Date cutOff = LateRerunHandler.getCutOffTime(feed, nm);
        Assert.assertEquals(EntityUtil.parseDateUTC("2013-10-02T12:00Z"), cutOff);

        lateArrival.setCutOff(Frequency.fromString("days(10000000)"));
        cutOff = LateRerunHandler.getCutOffTime(feed, nm);
        Assert.assertTrue(cutOff.after(new Date()));
    }
View Full Code Here

        Assert.assertEquals(process.getOutputs().getOutputs().get(0).getInstance(), "today(0,0)");

        Assert.assertEquals(process.getProperties().getProperties().get(0).getName(), "name1");
        Assert.assertEquals(process.getProperties().getProperties().get(0).getValue(), "value1");

        Cluster processCluster = process.getClusters().getClusters().get(0);
        Assert.assertEquals(SchemaHelper.formatDateUTC(processCluster.getValidity().getStart()), "2011-11-02T00:00Z");
        Assert.assertEquals(SchemaHelper.formatDateUTC(processCluster.getValidity().getEnd()), "2011-12-30T00:00Z");
        Assert.assertEquals(process.getTimezone().getID(), "UTC");

        Assert.assertEquals(process.getWorkflow().getEngine().name().toLowerCase(), "oozie");
        Assert.assertEquals(process.getWorkflow().getPath(), "/path/to/workflow");
View Full Code Here

                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 {
            input.setOptional(Boolean.TRUE);
            Assert.assertTrue(input.isOptional());
            parser.validate(process);
            Assert.fail("Validation exception must have been thrown.");
        } catch (FalconException e) {
            Assert.assertTrue(e instanceof ValidationException);
        }
View Full Code Here

        storeEntity(EntityType.FEED, "imp-click-join1");
        storeEntity(EntityType.FEED, "imp-click-join2");
        Feed feed = parser.parseAndValidate(this.getClass()
                .getResourceAsStream(FEED_XML));
        ConfigurationStore.get().publish(EntityType.FEED, feed);
        Process process = processParser.parseAndValidate(this.getClass()
                .getResourceAsStream(PROCESS1_XML));
        ConfigurationStore.get().publish(EntityType.PROCESS, process);
        Process p1 = (Process) process.copy();
        p1.setName("sample2");
        ConfigurationStore.get().publish(EntityType.PROCESS, p1);

        try {
            //Try parsing the same feed xml
            parser.parseAndValidate(this.getClass()
View Full Code Here

TOP

Related Classes of org.apache.falcon.entity.v0.EntityType

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.