Skip to content

Commit

Permalink
[SPARK-13416][GraphX] Add positive check for option 'numIter' in Stro…
Browse files Browse the repository at this point in the history
…nglyConnectedComponents

JIRA: https://issues.apache.org/jira/browse/SPARK-13416

## What changes were proposed in this pull request?

The output of StronglyConnectedComponents with numIter no greater than 1 may make no sense. So I just add require check in it.

## How was the this patch tested?

 unit tests passed

Author: Zheng RuiFeng <ruifengz@foxmail.com>

Closes #11284 from zhengruifeng/scccheck.
  • Loading branch information
zhengruifeng authored and rxin committed Feb 21, 2016
1 parent 7925071 commit d806ed3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object StronglyConnectedComponents {
* @return a graph with vertex attributes containing the smallest vertex id in each SCC
*/
def run[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED], numIter: Int): Graph[VertexId, ED] = {

require(numIter > 0, s"Number of iterations ${numIter} must be greater than 0.")
// the graph we update with final SCC ids, and the graph we return at the end
var sccGraph = graph.mapVertices { case (vid, _) => vid }
// graph we are going to work with in our iterations
Expand Down

0 comments on commit d806ed3

Please sign in to comment.