org.apache.flink.graph.utils.GraphUtils.IdentityMapper Java Examples

The following examples show how to use org.apache.flink.graph.utils.GraphUtils.IdentityMapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GatherSumApplyITCase.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@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<>(), env);

	List<Vertex<LongValue, LongValue>> result = inputGraph.run(
		new GSAConnectedComponents<>(16)).collect();

	compareResultAsTuples(result, expectedResultCC);
}
 
Example #2
Source File: GatherSumApplyITCase.java    From flink with Apache License 2.0 6 votes vote down vote up
@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<>(), env);

	List<Vertex<LongValue, LongValue>> result = inputGraph.run(
		new GSAConnectedComponents<>(16)).collect();

	compareResultAsTuples(result, expectedResultCC);
}
 
Example #3
Source File: GatherSumApplyITCase.java    From flink with Apache License 2.0 6 votes vote down vote up
@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<>(), env);

	List<Vertex<LongValue, LongValue>> result = inputGraph.run(
		new GSAConnectedComponents<>(16)).collect();

	compareResultAsTuples(result, expectedResultCC);
}
 
Example #4
Source File: GatherSumApplyITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@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<>(), env);

	List<Vertex<Long, Long>> result = inputGraph.run(
		new GSAConnectedComponents<>(16)).collect();

	compareResultAsTuples(result, expectedResultCC);
}
 
Example #5
Source File: GatherSumApplyITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@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<>(), env);

	List<Vertex<Long, Long>> result = inputGraph.run(
		new GSAConnectedComponents<>(16)).collect();

	compareResultAsTuples(result, expectedResultCC);
}
 
Example #6
Source File: GatherSumApplyITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@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<>(), env);

	List<Vertex<Long, Long>> result = inputGraph.run(
		new GSAConnectedComponents<>(16)).collect();

	compareResultAsTuples(result, expectedResultCC);
}