public static DataSet<Long> getDefaultVertexDataSet(ExecutionEnvironment env) { return env.fromElements( 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L); }
public static DataSet<Long> getDefaultVertexDataSet(ExecutionEnvironment env) { return env.fromElements( 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L); }
public static DataSet<String> getDefaultTextLineDataSet(ExecutionEnvironment env) { return env.fromElements( "To be, or not to be,--that is the question:--", "Whether 'tis nobler in the mind to suffer",
public static DataSet<String> getDefaultTextLineDataSet(ExecutionEnvironment env) { return env.fromElements( "To be, or not to be,--that is the question:--", "Whether 'tis nobler in the mind to suffer",
public static DataSet<Centroid> getDefaultCentroidDataSet(ExecutionEnvironment env) { return env.fromElements( new Centroid(1, -31.85, -44.77), new Centroid(2, 35.16, 17.46), new Centroid(3, -5.16, 21.93), new Centroid(4, -24.06, 6.81) ); }
public static DataSet<Centroid> getDefaultCentroidDataSet(ExecutionEnvironment env) { return env.fromElements( new Centroid(1, -31.85, -44.77), new Centroid(2, 35.16, 17.46), new Centroid(3, -5.16, 21.93), new Centroid(4, -24.06, 6.81) ); }
@Override protected void testProgram() throws Exception { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setDegreeOfParallelism(1); DataSet<Integer> data = env.fromElements(1, 2, 3, 4, 5, 6, 7, 8); IterativeDataSet<Integer> iteration = data.iterate(10); DataSet<Integer> result = data.reduceGroup(new PickOneAllReduce()).withBroadcastSet(iteration, "bc"); final List<Integer> resultList = new ArrayList<Integer>(); iteration.closeWith(result).output(new LocalCollectionOutputFormat<Integer>(resultList)); env.execute(); Assert.assertEquals(8, resultList.get(0).intValue()); }
public static DataSet<Edge> getDefaultEdgeDataSet(ExecutionEnvironment env) { return env.fromElements(new Edge(1, 2), new Edge(1, 3), new Edge(1, 4), new Edge(1, 5), new Edge(2, 3), new Edge(2, 5), new Edge(3, 4), new Edge(3, 7), new Edge(3, 8), new Edge(5, 6), new Edge(7, 8)); } }
public static DataSet<Edge> getDefaultEdgeDataSet(ExecutionEnvironment env) { return env.fromElements(new Edge(1, 2), new Edge(1, 3), new Edge(1, 4), new Edge(1, 5), new Edge(2, 3), new Edge(2, 5), new Edge(3, 4), new Edge(3, 7), new Edge(3, 8), new Edge(5, 6), new Edge(7, 8)); } }
@Override protected void testProgram() throws Exception { final int NUM_ITERS = 4; final double expectedFactor = (int) Math.pow(7, NUM_ITERS); // this is an artificial program, it does not compute anything sensical ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); @SuppressWarnings("unchecked") DataSet<Tuple2<Long, Double>> initialData = env.fromElements(new Tuple2<Long, Double>(1L, 1.0), new Tuple2<Long, Double>(2L, 2.0), new Tuple2<Long, Double>(3L, 3.0), new Tuple2<Long, Double>(4L, 4.0), new Tuple2<Long, Double>(5L, 5.0), new Tuple2<Long, Double>(6L, 6.0)); DataSet<Tuple2<Long, Double>> result = MultipleJoinsWithSolutionSetCompilerTest.constructPlan(initialData, NUM_ITERS); List<Tuple2<Long, Double>> resultCollector = new ArrayList<Tuple2<Long,Double>>(); result.output(new LocalCollectionOutputFormat<Tuple2<Long,Double>>(resultCollector)); env.execute(); for (Tuple2<Long, Double> tuple : resultCollector) { Assert.assertEquals(expectedFactor * tuple.f0, tuple.f1.doubleValue(), 0.0); } } }
public static void main(String[] args) throws Exception { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); DataSet<Long> vertexIds = env.generateSequence(0, 10); DataSet<Tuple2<Long, Long>> edges = env.fromElements(new Tuple2<Long, Long>(0L, 2L), new Tuple2<Long, Long>(2L, 4L), new Tuple2<Long, Long>(4L, 8L), new Tuple2<Long, Long>(1L, 5L), new Tuple2<Long, Long>(3L, 7L), new Tuple2<Long, Long>(3L, 9L)); 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(); env.execute("Spargel Connected Components"); }
@Override protected void testProgram() throws Exception { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); DataSet<String> text = env.fromElements(WordCountData.TEXT); DataSet<Tuple2<String, Integer>> words = text.flatMap(new WordCount.Tokenizer()); DataSet<Tuple2<String, Integer>> result = words.groupBy(0).aggregate(Aggregations.SUM, 1); result.output(new LocalCollectionOutputFormat<Tuple2<String, Integer>>(resultsCollected)); env.execute("Word Count Collection"); } }
DataSet<Tuple2<Long, Double>> inputData = env.fromElements(new Tuple2<Long, Double>(1L, 1.0)); DataSet<Tuple2<Long, Double>> result = constructPlan(inputData, 10);
public static DataSet<Point> getDefaultPointDataSet(ExecutionEnvironment env) { return env.fromElements( new Point(-14.22, -48.01), new Point(-22.78, 37.10),
public static DataSet<Point> getDefaultPointDataSet(ExecutionEnvironment env) { return env.fromElements( new Point(-14.22, -48.01), new Point(-22.78, 37.10),