Java Code Examples for org.apache.flink.graph.Graph#inDegrees()
The following examples show how to use
org.apache.flink.graph.Graph#inDegrees() .
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: DegreesITCase.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void testInDegrees() throws Exception { /* * Test inDegrees() */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env), TestGraphUtils.getLongLongEdgeData(env), env); DataSet<Tuple2<Long, LongValue>> data = graph.inDegrees(); List<Tuple2<Long, LongValue>> result = data.collect(); expectedResult = "1,1\n" + "2,1\n" + "3,2\n" + "4,1\n" + "5,2\n"; compareResultAsTuples(result, expectedResult); }
Example 2
Source File: DegreesITCase.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void testInDegreesWithNoInEdge() throws Exception { /* * Test inDegrees() no ingoing edge */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env), TestGraphUtils.getLongLongEdgeDataWithZeroDegree(env), env); DataSet<Tuple2<Long, LongValue>> data = graph.inDegrees(); List<Tuple2<Long, LongValue>> result = data.collect(); expectedResult = "1,0\n" + "2,1\n" + "3,1\n" + "4,1\n" + "5,3\n"; compareResultAsTuples(result, expectedResult); }
Example 3
Source File: DegreesITCase.java From flink with Apache License 2.0 | 6 votes |
@Test public void testInDegrees() throws Exception { /* * Test inDegrees() */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env), TestGraphUtils.getLongLongEdgeData(env), env); DataSet<Tuple2<Long, LongValue>> data = graph.inDegrees(); List<Tuple2<Long, LongValue>> result = data.collect(); expectedResult = "1,1\n" + "2,1\n" + "3,2\n" + "4,1\n" + "5,2\n"; compareResultAsTuples(result, expectedResult); }
Example 4
Source File: DegreesITCase.java From flink with Apache License 2.0 | 6 votes |
@Test public void testInDegreesWithNoInEdge() throws Exception { /* * Test inDegrees() no ingoing edge */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env), TestGraphUtils.getLongLongEdgeDataWithZeroDegree(env), env); DataSet<Tuple2<Long, LongValue>> data = graph.inDegrees(); List<Tuple2<Long, LongValue>> result = data.collect(); expectedResult = "1,0\n" + "2,1\n" + "3,1\n" + "4,1\n" + "5,3\n"; compareResultAsTuples(result, expectedResult); }
Example 5
Source File: DegreesITCase.java From flink with Apache License 2.0 | 6 votes |
@Test public void testInDegrees() throws Exception { /* * Test inDegrees() */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env), TestGraphUtils.getLongLongEdgeData(env), env); DataSet<Tuple2<Long, LongValue>> data = graph.inDegrees(); List<Tuple2<Long, LongValue>> result = data.collect(); expectedResult = "1,1\n" + "2,1\n" + "3,2\n" + "4,1\n" + "5,2\n"; compareResultAsTuples(result, expectedResult); }
Example 6
Source File: DegreesITCase.java From flink with Apache License 2.0 | 6 votes |
@Test public void testInDegreesWithNoInEdge() throws Exception { /* * Test inDegrees() no ingoing edge */ final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Graph<Long, Long, Long> graph = Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env), TestGraphUtils.getLongLongEdgeDataWithZeroDegree(env), env); DataSet<Tuple2<Long, LongValue>> data = graph.inDegrees(); List<Tuple2<Long, LongValue>> result = data.collect(); expectedResult = "1,0\n" + "2,1\n" + "3,1\n" + "4,1\n" + "5,3\n"; compareResultAsTuples(result, expectedResult); }