Package eu.stratosphere.api.java.record.operators

Examples of eu.stratosphere.api.java.record.operators.FileDataSource


  @SuppressWarnings("unchecked")
  private static Plan getPlanForWorksetConnectedComponentsWithSolutionSetAsFirstInput(
      int numSubTasks, String verticesInput, String edgeInput, String output, int maxIterations)
  {
    // create DataSourceContract for the vertices
    FileDataSource initialVertices = new FileDataSource(new CsvInputFormat(' ', LongValue.class), verticesInput, "Vertices");
   
    MapOperator verticesWithId = MapOperator.builder(DuplicateLongMap.class).input(initialVertices).name("Assign Vertex Ids").build();
   
    DeltaIteration iteration = new DeltaIteration(0, "Connected Components Iteration");
    iteration.setInitialSolutionSet(verticesWithId);
    iteration.setInitialWorkset(verticesWithId);
    iteration.setMaximumNumberOfIterations(maxIterations);
   
    // create DataSourceContract for the edges
    FileDataSource edges = new FileDataSource(new CsvInputFormat(' ', LongValue.class, LongValue.class), edgeInput, "Edges");

    // create CrossOperator for distance computation
    JoinOperator joinWithNeighbors = JoinOperator.builder(new NeighborWithComponentIDJoin(), LongValue.class, 0, 0)
        .input1(iteration.getWorkset())
        .input2(edges)
View Full Code Here


  @SuppressWarnings({ "deprecation", "unchecked" })
  @Test
  public void testUnionPropertyOldApiPropagation() {
    // construct the plan

    FileDataSource sourceA = new FileDataSource(new DummyInputFormat(), IN_FILE);
    FileDataSource sourceB = new FileDataSource(new DummyInputFormat(), IN_FILE);
   
    ReduceOperator redA = ReduceOperator.builder(new IdentityReduce(), IntValue.class, 0)
      .input(sourceA)
      .build();
    ReduceOperator redB = ReduceOperator.builder(new IdentityReduce(), IntValue.class, 0)
View Full Code Here

 
      // construct the plan
      final String out1Path = "file:///test/1";
      final String out2Path = "file:///test/2";
 
      FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);
 
      MapOperator mapA = MapOperator.builder(IdentityMap.class).input(sourceA).name("Map A").build();
      MapOperator mapC = MapOperator.builder(IdentityMap.class).input(mapA).name("Map C").build();
 
      FileDataSink[] sinkA = new FileDataSink[SINKS];
View Full Code Here

      // construct the plan
      final String out1Path = "file:///test/1";
      final String out2Path = "file:///test/2";
      final String out3Path = "file:///test/3";
 
      FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);

      MapOperator mapA = MapOperator.builder(IdentityMap.class).input(sourceA).name("Map A").build();
      MapOperator mapB = MapOperator.builder(IdentityMap.class).input(mapA).name("Map B").build();
      MapOperator mapC = MapOperator.builder(IdentityMap.class).input(mapA).name("Map C").build();
     
View Full Code Here

   */
  @Test
  public void testBranchingSourceMultipleTimes() {
    try {
      // construct the plan
      FileDataSource sourceA = new FileDataSource(new DummyInputFormat(), IN_FILE);
     
      JoinOperator mat1 = JoinOperator.builder(new DummyMatchStub(), IntValue.class, 0, 0)
        .input1(sourceA)
        .input2(sourceA)
        .build();
View Full Code Here

      // construct the plan
      final String out1Path = "file:///test/1";
      final String out2Path = "file:///test/2";
      final String out3Path = "file:///test/3";
 
      FileDataSource sourceA = new FileDataSource(new DummyInputFormat(), IN_FILE);
      FileDataSource sourceB = new FileDataSource(new DummyInputFormat(), IN_FILE);
      FileDataSource sourceC = new FileDataSource(new DummyInputFormat(), IN_FILE);
     
      CoGroupOperator co = CoGroupOperator.builder(new DummyCoGroupStub(), IntValue.class, 0,0)
        .input1(sourceA)
        .input2(sourceB)
        .build();
View Full Code Here

 
  @Test
  public void testBranchEachContractType() {
    try {
      // construct the plan
      FileDataSource sourceA = new FileDataSource(new DummyInputFormat(), "file:///test/file1", "Source A");
      FileDataSource sourceB = new FileDataSource(new DummyInputFormat(), "file:///test/file2", "Source B");
      FileDataSource sourceC = new FileDataSource(new DummyInputFormat(), "file:///test/file3", "Source C");
     
      MapOperator map1 = MapOperator.builder(new IdentityMap()).input(sourceA).name("Map 1").build();
     
      ReduceOperator reduce1 = ReduceOperator.builder(new IdentityReduce(), IntValue.class, 0)
        .input(map1)
View Full Code Here

  @Test
  public void testBranchingUnion() {
    try {
      // construct the plan
      FileDataSource source1 = new FileDataSource(new DummyInputFormat(), IN_FILE);
      FileDataSource source2 = new FileDataSource(new DummyInputFormat(), IN_FILE);
     
      JoinOperator mat1 = JoinOperator.builder(new DummyMatchStub(), IntValue.class, 0, 0)
        .input1(source1)
        .input2(source2)
        .name("Match 1")
View Full Code Here

    try {
      // construct the plan
      final String out1Path = "file:///test/1";
      final String out2Path = "file:///test/2";
 
      FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);
     
      FileDataSink sinkA = new FileDataSink(DummyOutputFormat.class, out1Path, sourceA);
      FileDataSink sinkB = new FileDataSink(DummyOutputFormat.class, out2Path, sourceA);
     
      List<FileDataSink> sinks = new ArrayList<FileDataSink>();
View Full Code Here

  public void testSimpleDisjointPlan() {
    // construct the plan
    final String out1Path = "file:///test/1";
    final String out2Path = "file:///test/2";

    FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);
    FileDataSource sourceB = new FileDataSource(DummyInputFormat.class, IN_FILE);
   
    FileDataSink sinkA = new FileDataSink(DummyOutputFormat.class, out1Path, sourceA);
    FileDataSink sinkB = new FileDataSink(DummyOutputFormat.class, out2Path, sourceB);
   
    List<FileDataSink> sinks = new ArrayList<FileDataSink>();
View Full Code Here

TOP

Related Classes of eu.stratosphere.api.java.record.operators.FileDataSource

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.