Search in sources :

Example 1 with LongToLongValue

use of org.apache.flink.graph.asm.translate.translators.LongToLongValue in project flink by apache.

the class GatherSumApplyITCase method testConnectedComponentsWithObjectReuseEnabled.

@Test
public void testConnectedComponentsWithObjectReuseEnabled() throws Exception {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    env.getConfig().enableObjectReuse();
    DataSet<Edge<LongValue, NullValue>> edges = Translate.translateEdgeIds(ConnectedComponentsDefaultData.getDefaultEdgeDataSet(env), new LongToLongValue());
    Graph<LongValue, LongValue, NullValue> inputGraph = Graph.fromDataSet(edges, new IdentityMapper<LongValue>(), env);
    List<Vertex<LongValue, LongValue>> result = inputGraph.run(new GSAConnectedComponents<LongValue, LongValue, NullValue>(16)).collect();
    compareResultAsTuples(result, expectedResultCC);
}
Also used : Vertex(org.apache.flink.graph.Vertex) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) NullValue(org.apache.flink.types.NullValue) LongToLongValue(org.apache.flink.graph.asm.translate.translators.LongToLongValue) LongValue(org.apache.flink.types.LongValue) LongToLongValue(org.apache.flink.graph.asm.translate.translators.LongToLongValue) GSAConnectedComponents(org.apache.flink.graph.library.GSAConnectedComponents) Edge(org.apache.flink.graph.Edge) Test(org.junit.Test)

Aggregations

ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)1 Edge (org.apache.flink.graph.Edge)1 Vertex (org.apache.flink.graph.Vertex)1 LongToLongValue (org.apache.flink.graph.asm.translate.translators.LongToLongValue)1 GSAConnectedComponents (org.apache.flink.graph.library.GSAConnectedComponents)1 LongValue (org.apache.flink.types.LongValue)1 NullValue (org.apache.flink.types.NullValue)1 Test (org.junit.Test)1