Package org.apache.flink.api.java.record.operators

Examples of org.apache.flink.api.java.record.operators.JoinOperator


    ReduceOperator buildTriads = ReduceOperator.builder(new BuildTriads(), IntValue.class, 0)
        .input(toLowerDegreeEdge)
        .name("Build Triads")
        .build();

    JoinOperator closeTriads = JoinOperator.builder(new CloseTriads(), IntValue.class, 1, 0)
        .keyField(IntValue.class, 2, 1)
        .input1(buildTriads)
        .input2(projectOutCounts)
        .name("Close Triads")
        .build();
    closeTriads.setParameter("INPUT_SHIP_STRATEGY", "SHIP_REPARTITION_HASH");
    closeTriads.setParameter("LOCAL_STRATEGY", "LOCAL_STRATEGY_HASH_BUILD_SECOND");

    FileDataSink triangles = new FileDataSink(new TriangleOutputFormat(), output, closeTriads, "Triangles");

    Plan p = new Plan(triangles, "Enumerate Triangles");
    p.setDefaultParallelism(numSubTasks);
View Full Code Here


    TPCHQuery3 query = new TPCHQuery3();
    Plan p = query.getPlan(DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE);
   
    // set compiler hints
    OperatorResolver cr = getContractResolver(p);
    JoinOperator match = cr.getNode("JoinLiO");
    match.getCompilerHints().setFilterFactor(100f);
   
    testQueryGeneric(100l*1024*1024*1024*1024, 100l*1024*1024*1024*1024, 0.05f, 100f, false, true, false, false, true);
  }
View Full Code Here

      // set statistics
      OperatorResolver cr = getContractResolver(p);
      FileDataSource ordersSource = cr.getNode(ORDERS);
      FileDataSource lineItemSource = cr.getNode(LINEITEM);
      MapOperator mapper = cr.getNode(MAPPER_NAME);
      JoinOperator joiner = cr.getNode(JOIN_NAME);
      setSourceStatistics(ordersSource, orderSize, 100f);
      setSourceStatistics(lineItemSource, lineitemSize, 140f);
      mapper.getCompilerHints().setAvgOutputRecordSize(16f);
      mapper.getCompilerHints().setFilterFactor(orderSelectivity);
      joiner.getCompilerHints().setFilterFactor(joinSelectivity);
     
      // compile
      final OptimizedPlan plan = compileWithStats(p);
      final OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);
     
View Full Code Here

    // Sc3 generates N y values to be evaluated with the polynomial identified by id
    FileDataSource sc3 = new FileDataSource(new CsvInputFormat(), sc3Path);
    CsvInputFormat.configureRecordFormat(sc3).fieldDelimiter(' ').field(StringValue.class, 0).field(IntValue.class, 1);

    // Jn1 matches x and y values on id and emits (id, x, y) triples
    JoinOperator jn1 = JoinOperator.builder(Jn1.class, StringValue.class, 0, 0).input1(sc2).input2(sc3).build();

    // Jn2 matches polynomial and arguments by id, computes p = min(P(x),P(y)) and emits (id, p) tuples
    JoinOperator jn2 = JoinOperator.builder(Jn2.class, StringValue.class, 0, 0).input1(jn1).input2(sc1).build();

    // Mp1 selects (id, x, y) triples where x = y and broadcasts z (=x=y) to Mp2
    MapOperator mp1 = MapOperator.builder(Mp1.class).input(jn1).build();

    // Mp2 filters out all p values which can be divided by z
View Full Code Here

   
    // 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)
        .name("Join Candidate Id With Neighbor")
        .build();

    // create ReduceOperator for finding the nearest cluster centers
    ReduceOperator minCandidateId = ReduceOperator.builder(new MinimumComponentIDReduce(), LongValue.class, 0)
        .input(joinWithNeighbors)
        .name("Find Minimum Candidate Id")
        .build();
   
    // create CrossOperator for distance computation
    JoinOperator updateComponentId = JoinOperator.builder(new UpdateComponentIdMatchMirrored(), LongValue.class, 0, 0)
        .input1(iteration.getSolutionSet())
        .input2(minCandidateId)
        .name("Update Component Id")
        .build();
   
View Full Code Here

   
    // 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)
        .name("Join Candidate Id With Neighbor")
        .build();
View Full Code Here

      .build();
    filterVisits.getCompilerHints().setFilterFactor(0.2f);

    // Create JoinOperator to join the filtered documents and ranks
    // relation
    JoinOperator joinDocsRanks = JoinOperator.builder(new JoinDocRanks(), StringValue.class, 0, 0)
      .input1(filterDocs)
      .input2(filterRanks)
      .name("Join Docs Ranks")
      .build();
View Full Code Here

        MapOperator.builder(OFilter.class)
      .name("OrdersFilter")
      .build();
    ordersFilter.setDegreeOfParallelism(degreeOfParallelism);
   
    JoinOperator join =
        JoinOperator.builder(JoinLiO.class, IntValue.class, 0, 0)
      .name("OrdersLineitemsJoin")
      .build();
      join.setDegreeOfParallelism(degreeOfParallelism);
   
    ReduceOperator aggregation =
        ReduceOperator.builder(CountAgg.class, StringValue.class, 0)
      .name("AggregateGroupBy")
      .build();
    aggregation.setDegreeOfParallelism(this.degreeOfParallelism);
   
    lineFilter.setInput(lineItems);
    ordersFilter.setInput(orders);
    join.setFirstInput(ordersFilter);
    join.setSecondInput(lineFilter);
    aggregation.setInput(join);
    result.setInput(aggregation);
   
     
    return new Plan(result, "TPC-H 4");
View Full Code Here

   
    // 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)
        .name("Join Candidate Id With Neighbor")
        .build();
View Full Code Here

      .fieldDelimiter('|')
      .field(IntValue.class, 0)
      .field(StringValue.class, 6);
   
    // create JoinOperator for joining Orders and LineItems
    JoinOperator joinCO = JoinOperator.builder(new JoinCO(), IntValue.class, 0, 0)
      .name("JoinCO")
      .build();
    joinCO.setDegreeOfParallelism(numSubtasks);

    // create ReduceOperator for aggregating the result
    ReduceOperator aggCO = ReduceOperator.builder(new AggCO(), StringValue.class, 1)
      .name("AggCo")
      .build();
    aggCO.setDegreeOfParallelism(numSubtasks);

    // create DataSinkContract for writing the result
    FileDataSink result = new FileDataSink(new CsvOutputFormat(), output, "Output");
    result.setDegreeOfParallelism(numSubtasks);
    CsvOutputFormat.configureRecordFormat(result)
      .recordDelimiter('\n')
      .fieldDelimiter('|')
      .field(IntValue.class, 0)
      .field(StringValue.class, 1);

    // assemble the plan
    result.setInput(aggCO);
    aggCO.setInput(joinCO);
    joinCO.setFirstInput(orders);
    joinCO.setSecondInput(customers);

    return new Plan(result, "TPCH Asterix");
  }
View Full Code Here

TOP

Related Classes of org.apache.flink.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.