File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
graphx/src/main/scala/org/apache/spark/graphx/lib Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -107,13 +107,10 @@ object TriangleCount {
107107 // compute the intersection along edges
108108 val counters : VertexRDD [Int ] = setGraph.aggregateMessages(edgeFunc, _ + _)
109109 // Merge counters with the graph and divide by two since each triangle is counted twice
110- graph.outerJoinVertices(counters) { (vid , _, optCounter : Option [Int ]) =>
110+ graph.outerJoinVertices(counters) { (_ , _, optCounter : Option [Int ]) =>
111111 val dblCount = optCounter.getOrElse(0 )
112112 // This algorithm double counts each triangle so the final count should be even
113- val isEven = (dblCount & 1 ) == 0
114- if (! isEven) {
115- throw new Exception (" Triangle count resulted in an invalid number of triangles." )
116- }
113+ require(dblCount % 2 == 0 , " Triangle count resulted in an invalid number of triangles." )
117114 dblCount / 2
118115 }
119116 }
You can’t perform that action at this time.
0 commit comments