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

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


    } else {
      pathsInput = new FileDataSource(new PathInFormat(), paths, "Paths");
    }
    pathsInput.setDegreeOfParallelism(numSubTasks);

    JoinOperator concatPaths =
        JoinOperator.builder(new ConcatPaths(), StringValue.class, 0, 1)
      .name("Concat Paths")
      .build();

    concatPaths.setDegreeOfParallelism(numSubTasks);

    CoGroupOperator findShortestPaths =
        CoGroupOperator.builder(new FindShortestPath(), StringValue.class, 0, 0)
      .keyField(StringValue.class, 1, 1)
      .name("Find Shortest Paths")
      .build();
    findShortestPaths.setDegreeOfParallelism(numSubTasks);

    FileDataSink result = new FileDataSink(new PathOutFormat(),output, "New Paths");
    result.setDegreeOfParallelism(numSubTasks);

    result.setInput(findShortestPaths);
    findShortestPaths.setFirstInput(pathsInput);
    findShortestPaths.setSecondInput(concatPaths);
    concatPaths.setFirstInput(pathsInput);
    concatPaths.setSecondInput(pathsInput);

    return new Plan(result, "Pairwise Shortest Paths");

  }
View Full Code Here


    MapOperator projectN = MapOperator.builder(ProjectN.class)
      .name("ProjectN")
      .build();

    JoinOperator joinOL = JoinOperator.builder(JoinOL.class, IntValue.class, 0, 0)
      .name("JoinOL")
      .build();

    JoinOperator joinCOL = JoinOperator.builder(JoinCOL.class, IntValue.class, 0, 0)
      .name("JoinCOL")
      .build();

    JoinOperator joinNCOL = JoinOperator.builder(JoinNCOL.class, IntValue.class, 4, 0)
      .name("JoinNCOL")
      .build();

    ReduceOperator reduce = ReduceOperator.builder(Sum.class)
      .keyField(IntValue.class, 0)
      .keyField(StringValue.class, 1)
      .keyField(StringValue.class, 3)
      .keyField(StringValue.class, 4)
      .keyField(StringValue.class, 5)
      .keyField(StringValue.class, 6)
      .keyField(StringValue.class, 7)
      .name("Reduce")
      .build();

    FileDataSink result = new FileDataSink(new TupleOutputFormat(), resultPath, "Output");

    result.setInput(reduce);
   
    reduce.setInput(joinNCOL);
   
    joinNCOL.setFirstInput(joinCOL);
    joinNCOL.setSecondInput(projectN);
   
    joinCOL.setFirstInput(projectC);
    joinCOL.setSecondInput(joinOL);
   
    joinOL.setFirstInput(mapO);
View Full Code Here

   
    // data source for the edges
    FileDataSource edges = new FileDataSource(new CsvInputFormat(' ', LongValue.class, LongValue.class), edgeInput, "Edges");

    // join workset (changed vertices) with the edges to propagate changes to neighbors
    JoinOperator joinWithNeighbors = JoinOperator.builder(new NeighborWithComponentIDJoin(), LongValue.class, 0, 0)
        .input1(iteration.getWorkset())
        .input2(edges)
        .name("Join Candidate Id With Neighbor")
        .build();

    // find for each neighbor the smallest of all candidates
    ReduceOperator minCandidateId = ReduceOperator.builder(new MinimumComponentIDReduce(), LongValue.class, 0)
        .input(joinWithNeighbors)
        .name("Find Minimum Candidate Id")
        .build();
   
    // join candidates with the solution set and update if the candidate component-id is smaller
    JoinOperator updateComponentId = JoinOperator.builder(new UpdateComponentIdMatchNonPreserving(), LongValue.class, 0, 0)
        .input1(minCandidateId)
        .input2(iteration.getSolutionSet())
        .name("Update Component Id")
        .build();
   
View Full Code Here

      new GenericDataSource<InfiniteIntegerInputFormatWithDelay>(new InfiniteIntegerInputFormatWithDelay(), "Source 1");

    GenericDataSource<InfiniteIntegerInputFormatWithDelay> source2 =
      new GenericDataSource<InfiniteIntegerInputFormatWithDelay>(new InfiniteIntegerInputFormatWithDelay(), "Source 2");
   
    JoinOperator matcher = JoinOperator.builder(SimpleMatcher.class, IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Sort Join")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

      new GenericDataSource<InfiniteIntegerInputFormat>(new InfiniteIntegerInputFormat(), "Source 1");

    GenericDataSource<InfiniteIntegerInputFormat> source2 =
      new GenericDataSource<InfiniteIntegerInputFormat>(new InfiniteIntegerInputFormat(), "Source 2");
   
    JoinOperator matcher = JoinOperator.builder(SimpleMatcher.class, IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Sort Join")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

      new GenericDataSource<InfiniteIntegerInputFormat>(new InfiniteIntegerInputFormat(), "Source 1");

    GenericDataSource<InfiniteIntegerInputFormat> source2 =
      new GenericDataSource<InfiniteIntegerInputFormat>(new InfiniteIntegerInputFormat(), "Source 2");
   
    JoinOperator matcher = JoinOperator.builder(StuckInOpenMatcher.class, IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Stuc-In-Open Match")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

    GenericDataSource<UniformIntInput> source2 =
      new GenericDataSource<UniformIntInput>(new UniformIntInput(), "Source 2");
    source2.setParameter(UniformIntInput.NUM_KEYS_KEY, 50000);
    source2.setParameter(UniformIntInput.NUM_VALUES_KEY, 100);
   
    JoinOperator matcher = JoinOperator.builder(SimpleMatcher.class, IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Long Cancelling Sort Join")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

    GenericDataSource<UniformIntInput> source2 =
      new GenericDataSource<UniformIntInput>(new UniformIntInput(), "Source 2");
    source2.setParameter(UniformIntInput.NUM_KEYS_KEY, 500);
    source2.setParameter(UniformIntInput.NUM_VALUES_KEY, 3);
   
    JoinOperator matcher = JoinOperator.builder(DelayingMatcher.class, IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Long Cancelling Sort Join")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

    GenericDataSource<UniformIntInput> source2 =
      new GenericDataSource<UniformIntInput>(new UniformIntInput(), "Source 2");
    source2.setParameter(UniformIntInput.NUM_KEYS_KEY, 500);
    source2.setParameter(UniformIntInput.NUM_VALUES_KEY, 3);
   
    JoinOperator matcher = JoinOperator.builder(LongCancelTimeMatcher.class, IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Long Cancelling Sort Join")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

      new GenericDataSource<InfiniteIntegerInputFormat>(new InfiniteIntegerInputFormat(), "Source 1");

    GenericDataSource<InfiniteIntegerInputFormat> source2 =
      new GenericDataSource<InfiniteIntegerInputFormat>(new InfiniteIntegerInputFormat(), "Source 2");
   
    JoinOperator matcher = JoinOperator.builder(new SimpleMatcher(), IntValue.class, 0, 0)
      .input1(source1)
      .input2(source2)
      .name("Sort Join")
      .build();
    GenericDataSink sink = new GenericDataSink(new DiscardingOutputFormat(), matcher, "Sink");
View Full Code Here

TOP

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

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.