use of org.apache.flink.graph.asm.translate.TranslateVertexValues in project flink by apache.
the class SummarizationITCase method testWithVertexAndEdgeLongValues.
@Test
public void testWithVertexAndEdgeLongValues() throws Exception {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Graph<Long, Long, Long> input = Graph.fromDataSet(SummarizationData.getVertices(env), SummarizationData.getEdges(env), env).run(new TranslateVertexValues<>(new StringToLong())).run(new TranslateEdgeValues<>(new StringToLong()));
List<Vertex<Long, Summarization.VertexValue<Long>>> summarizedVertices = new ArrayList<>();
List<Edge<Long, EdgeValue<Long>>> summarizedEdges = new ArrayList<>();
Graph<Long, Summarization.VertexValue<Long>, EdgeValue<Long>> output = input.run(new Summarization<>());
output.getVertices().output(new LocalCollectionOutputFormat<>(summarizedVertices));
output.getEdges().output(new LocalCollectionOutputFormat<>(summarizedEdges));
env.execute();
validateVertices(SummarizationData.EXPECTED_VERTICES, summarizedVertices);
validateEdges(SummarizationData.EXPECTED_EDGES_WITH_VALUES, summarizedEdges);
}
Aggregations