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

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


                FeedGroupMapTest.class
                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
        feed1.setName("f5" + System.currentTimeMillis());
        getStore().publish(EntityType.CLUSTER, cluster);
        feed1.setGroups(null);
        Location location = new Location();
        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
        location.setType(LocationType.DATA);
        feed1.setLocations(new Locations());
        feed1.getLocations().getLocations().add(location);
        getStore().publish(EntityType.FEED, feed1);

    }
View Full Code Here


        feed1.setName("f1");
        feed1.setGroups("group1,group2,group3");
        Location location = new Location();
        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
        location.setType(LocationType.DATA);
        feed1.setLocations(new Locations());
        feed1.getLocations().getLocations().add(location);
        getStore().publish(EntityType.FEED, feed1);
        Map<String, FeedGroup> groupMapping = FeedGroupMap.get()
                .getGroupsMapping();

        FeedGroup group = groupMapping.get("group1");
        Assert.assertEquals(group.getName(), "group1");
        Assert.assertEquals(group.getFeeds().size(), 1);
        assertFields(group, feed1);

        group = groupMapping.get("group2");
        Assert.assertEquals(group.getName(), "group2");
        Assert.assertEquals(group.getFeeds().size(), 1);
        assertFields(group, feed1);

        group = groupMapping.get("group3");
        Assert.assertEquals(group.getName(), "group3");
        Assert.assertEquals(group.getFeeds().size(), 1);
        assertFields(group, feed1);

        Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
                FeedGroupMapTest.class
                        .getResourceAsStream("/config/feed/feed-0.1.xml"));

        feed2.setName("f2");
        feed2.setGroups("group1,group5,group3");
        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/${MONTH}/${DAY}/ad2");
        location.setType(LocationType.DATA);
        feed2.setLocations(new Locations());
        feed2.getLocations().getLocations().add(location);
        getStore().publish(EntityType.FEED, feed2);
        groupMapping = FeedGroupMap.get().getGroupsMapping();

        group = groupMapping.get("group1");
View Full Code Here

        getStore().publish(EntityType.CLUSTER, cluster);
        feed1.setGroups("group7,group8,group9");
        Location location = new Location();
        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
        location.setType(LocationType.DATA);
        feed1.setLocations(new Locations());
        feed1.getLocations().getLocations().add(location);
        getStore().publish(EntityType.FEED, feed1);

        Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
                FeedGroupMapTest.class
                        .getResourceAsStream("/config/feed/feed-0.1.xml"));
        feed2.setName("f2");
        feed2.setGroups("group7,group8,group10");
        location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/${MONTH}/${DAY}/ad2");
        location.setType(LocationType.DATA);
        feed2.setLocations(new Locations());
        feed2.getLocations().getLocations().add(location);
        getStore().publish(EntityType.FEED, feed2);

        Map<String, FeedGroup> groupMapping = FeedGroupMap.get()
                .getGroupsMapping();
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

            addLibExtensionsToWorkflow(cluster, wfApp, EntityType.PROCESS, null);
        } catch (IOException e) {
            throw new FalconException("Failed to add library extensions for the workflow", e);
        }

        EngineType engineType = processWorkflow.getEngine();
        for (Object object : wfApp.getDecisionOrForkOrJoin()) {
            if (!(object instanceof ACTION)) {
                continue;
            }
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

        }
    }

    @Test
    public void testPublish() throws Exception {
        Process process = new Process();
        process.setName("hello");
        store.publish(EntityType.PROCESS, process);
        Process p = store.get(EntityType.PROCESS, "hello");
        Assert.assertEquals(p, process);

        store.registerListener(listener);
        process.setName("world");
        try {
View Full Code Here

        store.unregisterListener(listener);
    }

    @Test
    public void testGet() throws Exception {
        Process p = store.get(EntityType.PROCESS, "notfound");
        Assert.assertNull(p);
    }
View Full Code Here

        Assert.assertNull(p);
    }

    @Test
    public void testRemove() throws Exception {
        Process process = new Process();
        process.setName("remove");
        store.publish(EntityType.PROCESS, process);
        Process p = store.get(EntityType.PROCESS, "remove");
        Assert.assertEquals(p, process);
        store.remove(EntityType.PROCESS, "remove");
        p = store.get(EntityType.PROCESS, "remove");
        Assert.assertNull(p);
View Full Code Here

TOP

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

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.