Package org.apache.falcon.entity.v0.feed

Examples of org.apache.falcon.entity.v0.feed.Locations


        STORE.publish(EntityType.FEED, feed1);
        STORE.publish(EntityType.FEED, feed2);
        STORE.publish(EntityType.FEED, feed3);

        Process process1 = (Process) EntityType.PROCESS.getUnmarshaller()
                .unmarshal(this.getClass().getResource(PROCESS1_XML));
        STORE.publish(EntityType.PROCESS, process1);
        Process process2 = (Process) EntityType.PROCESS.getUnmarshaller()
                .unmarshal(this.getClass().getResource(PROCESS2_XML));
        STORE.publish(EntityType.PROCESS, process2);
    }
View Full Code Here


     * @param bundlePath - bundle path
     * @return COORDINATORAPP
     * @throws FalconException on Error
     */
    public COORDINATORAPP createDefaultCoordinator(Cluster cluster, Path bundlePath) throws FalconException {
        Process process = getEntity();
        if (process == null) {
            return null;
        }

        COORDINATORAPP coord = new COORDINATORAPP();
        String coordName = EntityUtil.getWorkflowName(Tag.DEFAULT, process).toString();
        Path coordPath = getCoordPath(bundlePath, coordName);

        // coord attributes
        initializeCoordAttributes(cluster, process, coord, coordName);

        CONTROLS controls = initializeControls(process); // controls
        coord.setControls(controls);

        // Configuration
        Map<String, String> props = createCoordDefaultConfiguration(cluster, coordPath, coordName);

        initializeInputPaths(cluster, process, coord, props); // inputs
        initializeOutputPaths(cluster, process, coord, props)// outputs

        Workflow processWorkflow = process.getWorkflow();
        props.put("userWorkflowEngine", processWorkflow.getEngine().value());

        // create parent wf
        createWorkflow(cluster, process, processWorkflow, coordName, coordPath);

View Full Code Here

        return expr;
    }

    @Override
    protected Map<String, String> getEntityProperties() {
        Process process = getEntity();
        Map<String, String> props = new HashMap<String, String>();
        if (process.getProperties() != null) {
            for (Property prop : process.getProperties().getProperties()) {
                props.put(prop.getName(), prop.getValue());
            }
        }
        return props;
    }
View Full Code Here

        Map<String, String> props = createCoordDefaultConfiguration(cluster, coordPath, coordName);

        initializeInputPaths(cluster, process, coord, props); // inputs
        initializeOutputPaths(cluster, process, coord, props)// outputs

        Workflow processWorkflow = process.getWorkflow();
        props.put("userWorkflowEngine", processWorkflow.getEngine().value());

        // create parent wf
        createWorkflow(cluster, process, processWorkflow, coordName, coordPath);

        WORKFLOW wf = new WORKFLOW();
View Full Code Here

  public void testValidFeedGroup() throws IvoryException, JAXBException {
    Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
        (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
    feed1.setName("f1" + System.currentTimeMillis());
    feed1.setGroups("group1,group2,group3");
    feed1.setLocations(new Locations());
    Location location = new Location();
    location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
    location.setType(LocationType.DATA);
    feed1.getLocations().getLocations().add(location);
    feed1.getClusters().getClusters().get(0).getLocations().getLocations().set(0, location);
    parser.parseAndValidate(feed1.toString());
    ConfigurationStore.get().publish(EntityType.FEED, feed1);

    Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
        (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
    feed2.setName("f2" + System.currentTimeMillis());
    feed2.setGroups("group1,group2,group5");
    feed2.setLocations(new Locations());
    Location location2 = new Location();
    location2
        .setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
    location2.setType(LocationType.DATA);
    feed2.getLocations().getLocations().add(location2);
View Full Code Here

  public void testInvalidFeedClusterDataLocation() throws JAXBException, IvoryException{
    Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
        (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
    feed1.setName("f1" + System.currentTimeMillis());
    feed1.setGroups("group1,group2,group3");
    feed1.setLocations(new Locations());
    Location location = new Location();
    location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
    location.setType(LocationType.DATA);
    feed1.getLocations().getLocations().add(location);
    parser.parseAndValidate(feed1.toString());
View Full Code Here

  public void testInvalidFeedGroup() throws IvoryException, JAXBException {
    Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
        (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
    feed1.setName("f1" + System.currentTimeMillis());
    feed1.setGroups("group1,group2,group3");
    feed1.setLocations(new Locations());
    Location location = new Location();
    location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
    location.setType(LocationType.DATA);
    feed1.getLocations().getLocations().add(location);
    parser.parseAndValidate(feed1.toString());
   
    feed1.getClusters().getClusters().get(0).getLocations().getLocations().set(0,location);
    ConfigurationStore.get().publish(EntityType.FEED, feed1);

    Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
        (FeedEntityParserTest.class.getResourceAsStream(FEED_XML)));
    feed2.setName("f2" + System.currentTimeMillis());
    feed2.setGroups("group1,group2,group5");
    feed2.setLocations(new Locations());
    Location location2 = new Location();
    location2
        .setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}/${HOUR}/ad");
    location2.setType(LocationType.DATA);
    feed2.getLocations().getLocations().add(location2);
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);
    store.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);
    store.publish(EntityType.FEED, feed2);
    groupMapping = FeedGroupMap.get().getGroupsMapping();

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

    store.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);
    store.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);
    store.publish(EntityType.FEED, feed2);

    Map<String, FeedGroup> groupMapping = FeedGroupMap.get()
        .getGroupsMapping();
View Full Code Here

    store.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);
    store.publish(EntityType.FEED, feed1);

  }
View Full Code Here

TOP

Related Classes of org.apache.falcon.entity.v0.feed.Locations

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.