Package org.apache.ivory.entity.v0.process

Examples of org.apache.ivory.entity.v0.process.Outputs


        clusterEntity.setLocations(locs);
    }

    private Interface newInterface(Interfacetype type,
                                   String endPoint, String version) {
        Interface iface = new Interface();
        iface.setType(type);
        iface.setEndpoint(endPoint);
        iface.setVersion(version);
        return iface;
    }
View Full Code Here


    return stringWriter.toString();
  }
 
  private Interface newInterface(Interfacetype type, String endPoint,
      String version) {
    Interface iface = new Interface();
    iface.setType(type);
    iface.setEndpoint(endPoint);
    iface.setVersion(version);
    return iface;
  }
View Full Code Here

        ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));

        Assert.assertNotNull(cluster);
        assertEquals(cluster.getName(), "testCluster");

        Interface execute = ClusterHelper.getInterface(cluster, Interfacetype.EXECUTE);

        assertEquals(execute.getEndpoint(), "localhost:8021");
        assertEquals(execute.getVersion(), "0.20.2");

        Interface readonly = ClusterHelper.getInterface(cluster, Interfacetype.READONLY);
        assertEquals(readonly.getEndpoint(), "hftp://localhost:50010");
        assertEquals(readonly.getVersion(), "0.20.2");

        Interface write = ClusterHelper.getInterface(cluster, Interfacetype.WRITE);
        //assertEquals(write.getEndpoint(), conf.get("fs.default.name"));
        assertEquals(write.getVersion(), "0.20.2");

        Interface workflow = ClusterHelper.getInterface(cluster, Interfacetype.WORKFLOW);
        assertEquals(workflow.getEndpoint(), "http://localhost:11000/oozie/");
        assertEquals(workflow.getVersion(), "3.1");

        assertEquals(ClusterHelper.getLocation(cluster, "staging"), "/projects/ivory/staging");

        StringWriter stringWriter = new StringWriter();
        Marshaller marshaller = EntityType.CLUSTER.getMarshaller();
View Full Code Here

        clusterEntity = new Cluster();
        clusterEntity.setName(name);
        clusterEntity.setColo("local");
        clusterEntity.setDescription("Embeded cluster: " + name);

        Interfaces interfaces = new Interfaces();
        interfaces.getInterfaces().add(newInterface(Interfacetype.WORKFLOW,
                "http://localhost:11000/oozie", "0.1"));
        String fsUrl = conf.get("fs.default.name");
        interfaces.getInterfaces().add(newInterface(Interfacetype.READONLY, fsUrl, "0.1"));
        interfaces.getInterfaces().add(newInterface(Interfacetype.WRITE, fsUrl, "0.1"));
        interfaces.getInterfaces().add(newInterface(Interfacetype.EXECUTE,
                        conf.get("mapred.job.tracker"), "0.1"));
    interfaces
        .getInterfaces()
        .add(newInterface(
            Interfacetype.MESSAGING,
            "vm://localhost",
            "0.1"));
View Full Code Here

            Interfacetype.MESSAGING,
            "vm://localhost",
            "0.1"));
      clusterEntity.setInterfaces(interfaces);

        Location location = new Location();
        location.setName("staging");
        location.setPath("/workflow/staging");
        Locations locs = new Locations();
        locs.getLocations().add(location);
        location = new Location();
        location.setName("working");
        location.setPath("/workflow/work");
        locs.getLocations().add(location);
        clusterEntity.setLocations(locs);
    }
View Full Code Here

      clusterEntity.setInterfaces(interfaces);

        Location location = new Location();
        location.setName("staging");
        location.setPath("/workflow/staging");
        Locations locs = new Locations();
        locs.getLocations().add(location);
        location = new Location();
        location.setName("working");
        location.setPath("/workflow/work");
        locs.getLocations().add(location);
        clusterEntity.setLocations(locs);
    }
View Full Code Here

    @Test
    public void testEvaluateExpression() throws Exception {
        Cluster cluster = new Cluster();
        cluster.setName("name");
        cluster.setColo("colo");
        cluster.setProperties(new Properties());
        Property prop = new Property();
        prop.setName("pname");
        prop.setValue("pvalue");
        cluster.getProperties().getProperties().add(prop);
       
View Full Code Here

    public void testEvaluateExpression() throws Exception {
        Cluster cluster = new Cluster();
        cluster.setName("name");
        cluster.setColo("colo");
        cluster.setProperties(new Properties());
        Property prop = new Property();
        prop.setName("pname");
        prop.setValue("pvalue");
        cluster.getProperties().getProperties().add(prop);
       
        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.colo}/*/US"), "colo/*/US");
        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.name}/*/${cluster.pname}"), "name/*/pvalue");
        Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "IN"), "IN");
View Full Code Here

        return null;
    }
   
  public static Location getLocation(Feed feed, LocationType type,
      String clusterName) {
    Cluster cluster = getCluster(feed, clusterName);
    if (cluster!=null &&cluster.getLocations() != null
        && cluster.getLocations() .getLocations().size() != 0) {
      return getLocation(cluster.getLocations() , type);
    }
    else{
      return getLocation(feed.getLocations(), type);
    }
View Full Code Here

        Input input = new Input();
        input.setFeed(feed);
        inputs.getInputs().add(input);
        Feed f1 = new Feed();
        f1.setName(feed);
        Clusters clusters = new Clusters();
        f1.setClusters(clusters);
        org.apache.ivory.entity.v0.feed.Cluster feedCluster =
                new org.apache.ivory.entity.v0.feed.Cluster();
        feedCluster.setName(cluster.getName());
        clusters.getClusters().add(feedCluster);
        return f1;
    }
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.v0.process.Outputs

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.