File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
graphx/src/main/scala/org/apache/spark/graphx/lib Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,14 @@ object Analytics extends Logging {
5858 var outFname = " "
5959 var numEPart = 4
6060 var partitionStrategy : Option [PartitionStrategy ] = None
61+ var numIterOpt : Option [Int ] = None
6162
6263 options.foreach{
6364 case (" tol" , v) => tol = v.toFloat
6465 case (" output" , v) => outFname = v
6566 case (" numEPart" , v) => numEPart = v.toInt
6667 case (" partStrategy" , v) => partitionStrategy = Some (pickPartitioner(v))
68+ case (" numIter" , v) => numIterOpt = Some (v.toInt)
6769 case (opt, _) => throw new IllegalArgumentException (" Invalid option: " + opt)
6870 }
6971
@@ -80,7 +82,10 @@ object Analytics extends Logging {
8082 println(" GRAPHX: Number of vertices " + graph.vertices.count)
8183 println(" GRAPHX: Number of edges " + graph.edges.count)
8284
83- val pr = graph.pageRank(tol).vertices.cache()
85+ val pr = (numIterOpt match {
86+ case Some (numIter) => PageRank .run(graph, numIter)
87+ case None => PageRank .runUntilConvergence(graph, tol)
88+ }).vertices.cache()
8489
8590 println(" GRAPHX: Total rank: " + pr.map(_._2).reduce(_ + _))
8691
You can’t perform that action at this time.
0 commit comments