use of org.apache.flink.graph.library.GSAConnectedComponents 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);
}
use of org.apache.flink.graph.library.GSAConnectedComponents in project flink by apache.
the class GatherSumApplyITCase method testConnectedComponentsWithObjectReuseDisabled.
@Test
public void testConnectedComponentsWithObjectReuseDisabled() throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.getConfig().disableObjectReuse();
Graph<Long, Long, NullValue> inputGraph = Graph.fromDataSet(ConnectedComponentsDefaultData.getDefaultEdgeDataSet(env), new IdentityMapper<Long>(), env);
List<Vertex<Long, Long>> result = inputGraph.run(new GSAConnectedComponents<Long, Long, NullValue>(16)).collect();
compareResultAsTuples(result, expectedResultCC);
}
Aggregations