Examples of fromElements()


Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

      final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
     
      // get input data
      DataSet<Long> pagesInput = env.fromElements(1l);
      @SuppressWarnings("unchecked")
      DataSet<Tuple2<Long, Long>> linksInput =env.fromElements(new Tuple2<Long, Long>(1l, 2l));
     
      // assign initial rank to pages
      DataSet<Tuple2<Long, Double>> pagesWithRanks = pagesInput.
          map(new RankAssigner((1.0d / 10)));
     
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

      // compose test program
      {
        DataSet<Long> vertexIds = env.generateSequence(1, 2);
       
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<Long, Long>> edges = env.fromElements(new Tuple2<Long, Long>(1L, 2L));
       
        DataSet<Tuple2<Long, Long>> initialVertices = vertexIds.map(new IdAssigner());
        DataSet<Tuple2<Long, Long>> result = initialVertices.runOperation(VertexCentricIteration.withPlainEdges(edges, new CCUpdater(), new CCMessager(), 100));
       
        result.print();
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

     
      ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
      env.setDegreeOfParallelism(DEFAULT_PARALLELISM);
      // compose test program
      {
        DataSet<Long> bcVar = env.fromElements(1L);
       
        DataSet<Long> vertexIds = env.generateSequence(1, 2);
       
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<Long, Long>> edges = env.fromElements(new Tuple2<Long, Long>(1L, 2L));
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

        DataSet<Long> bcVar = env.fromElements(1L);
       
        DataSet<Long> vertexIds = env.generateSequence(1, 2);
       
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<Long, Long>> edges = env.fromElements(new Tuple2<Long, Long>(1L, 2L));
       
        DataSet<Tuple2<Long, Long>> initialVertices = vertexIds.map(new IdAssigner());
       
        VertexCentricIteration<Long, Long, Long, ?> vcIter = VertexCentricIteration.withPlainEdges(edges, new CCUpdater(), new CCMessager(), 100);
        vcIter.addBroadcastSetForMessagingFunction(BC_VAR_NAME, bcVar);
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

      final int ITERATION_DOP = 77;
     
     
      ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
     
      DataSet<Long> bcMessaging = env.fromElements(1L);
      DataSet<Long> bcUpdate = env.fromElements(1L);
     
      DataSet<Tuple2<String, Double>> result;
     
      // ------------ construct the test program ------------------
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

     
     
      ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
     
      DataSet<Long> bcMessaging = env.fromElements(1L);
      DataSet<Long> bcUpdate = env.fromElements(1L);
     
      DataSet<Tuple2<String, Double>> result;
     
      // ------------ construct the test program ------------------
      {
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

     
      // ------------ construct the test program ------------------
      {
       
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<String, Double>> initialVertices = env.fromElements(new Tuple2<String, Double>("abc", 3.44));
 
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<String, String>> edges = env.fromElements(new Tuple2<String, String>("a", "c"));
       
       
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

       
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<String, Double>> initialVertices = env.fromElements(new Tuple2<String, Double>("abc", 3.44));
 
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<String, String>> edges = env.fromElements(new Tuple2<String, String>("a", "c"));
       
       
        VertexCentricIteration<String, Double, Long, ?> vertexIteration =
            VertexCentricIteration.withPlainEdges(edges, new UpdateFunction(), new MessageFunctionNoEdgeValue(), NUM_ITERATIONS);
        vertexIteration.addBroadcastSetForMessagingFunction(BC_SET_MESSAGES_NAME, bcMessaging);
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

      final int ITERATION_DOP = 77;
     
     
      ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
     
      DataSet<Long> bcVar = env.fromElements(1L);
     
      DataSet<Tuple2<String, Double>> result;
     
      // ------------ construct the test program ------------------
      {
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()

  @Override
  protected void testProgram() throws Exception {
    ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
   
    DataSet<Long> vertexIds = env.generateSequence(1, NUM_VERTICES);
    DataSet<String> edgeString = env.fromElements(ConnectedComponentsData.getRandomOddEvenEdges(NUM_EDGES, NUM_VERTICES, SEED).split("\n"));
   
    DataSet<Tuple2<Long, Long>> edges = edgeString.map(new EdgeParser());
   
    DataSet<Tuple2<Long, Long>> initialVertices = vertexIds.map(new IdAssigner());
    DataSet<Tuple2<Long, Long>> result = initialVertices.runOperation(VertexCentricIteration.withPlainEdges(edges, new CCUpdater(), new CCMessager(), 100));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.