Package org.apache.flink.api.java

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


        DataSet<CustomType> ds = CollectionDataSets.getCustomTypeDataSet(env);
        DataSet<CustomType> ds2 = CollectionDataSets.getCustomTypeDataSet(env);
        DataSet<CustomType> coGroupDs = ds.coGroup(ds2).where("myInt").equalTo("myInt").with(new CustomTypeCoGroup());
       
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return "1,0,test\n" +
            "2,6,test\n" +
            "3,24,test\n" +
View Full Code Here


                }
              }
            }
        });
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return   "-1,20000,Flink\n" +
            "-1,10000,Flink\n" +
            "-1,30000,Flink\n";
View Full Code Here

                }
              }
            }
        });
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return   "-1,20000,Flink\n" +
            "-1,10000,Flink\n" +
            "-1,30000,Flink\n";
View Full Code Here

                }
              }
            }
        });
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return   "-1,20000,Flink\n" +
            "-1,10000,Flink\n" +
            "-1,30000,Flink\n";
View Full Code Here

    //output the data with AvroOutputFormat for reflect user type
    DataSet<ReflectiveUser> reflectiveUser = specificUser.map(new ConvertToReflective());
    reflectiveUser.write(new AvroOutputFormat<ReflectiveUser>(ReflectiveUser.class), outputPath2);

    env.execute();
  }

  @Override
  protected void postSubmit() throws Exception {
    //compare result for specific user type
View Full Code Here

    source.output(JDBCOutputFormat.buildJDBCOutputFormat()
        .setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("insert into newbooks (id,title,author,price,qty) values (?,?,?,?,?)")
        .finish());
    environment.execute();
  }

  private static void prepareTestDb() throws Exception {
    String dbURL = "jdbc:derby:memory:ebookshop;create=true";
    Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
View Full Code Here

          verticesWithNewComponents.join(iteration).where(0).equalTo(0)
          .flatMap(new MinimumIdFilter());

      iteration.closeWith(updatedComponentId).writeAsText(resultPath);

      env.execute();

      return resultPath;
    }
  }
View Full Code Here

          verticesWithNewComponents.join(iteration).where(0).equalTo(0)
          .flatMap(new MinimumIdFilter());

      iteration.closeWith(updatedComponentId).writeAsText(resultPath);

      env.execute();

      return resultPath;
    }
  }
View Full Code Here

        iteration.registerAggregationConvergenceCriterion(NEGATIVE_ELEMENTS_AGGR, aggr,
            new NegativeElementsConvergenceCriterion());
       
        DataSet<Integer> updatedDs = iteration.map(new SubtractOneMap());
        iteration.closeWith(updatedDs).writeAsText(resultPath);
        env.execute();

        // return expected result
        return "-3\n" + "-2\n" + "-2\n" + "-1\n" + "-1\n"
             + "-1\n" + "0\n" + "0\n" + "0\n" + "0\n"
             + "1\n" + "1\n" + "1\n" + "1\n" + "1\n";
View Full Code Here

        iteration.registerAggregationConvergenceCriterion(NEGATIVE_ELEMENTS_AGGR, aggr,
            new NegativeElementsConvergenceCriterion());
       
        DataSet<Integer> updatedDs = iteration.map(new SubtractOneMapWithParam());
        iteration.closeWith(updatedDs).writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return "-3\n" + "-2\n" + "-2\n" + "-1\n" + "-1\n"
             + "-1\n" + "0\n" + "0\n" + "0\n" + "0\n"
             + "1\n" + "1\n" + "1\n" + "1\n" + "1\n";
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.