spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ankurd...@apache.org
Subject git commit: [graphX] GraphOps: random pick vertex bug
Date Tue, 30 Sep 2014 01:02:31 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.1 df5a62f51 -> e5ab11387


[graphX] GraphOps: random pick vertex bug

When `numVertices > 50`, probability is set to 0. This would cause infinite loop.

Author: yingjieMiao <yingjie@42go.com>

Closes #2553 from yingjieMiao/graphx and squashes the following commits:

6adf3c8 [yingjieMiao] [graphX] GraphOps: random pick vertex bug

(cherry picked from commit 51229ff7f4d3517706a1cdc1a2943ede1c605089)
Signed-off-by: Ankur Dave <ankurdave@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e5ab1138
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e5ab1138
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e5ab1138

Branch: refs/heads/branch-1.1
Commit: e5ab113871a3cd5abe0dd2466bd855ff2fb1bd20
Parents: df5a62f
Author: yingjieMiao <yingjie@42go.com>
Authored: Mon Sep 29 18:01:27 2014 -0700
Committer: Ankur Dave <ankurdave@gmail.com>
Committed: Mon Sep 29 18:02:21 2014 -0700

----------------------------------------------------------------------
 graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e5ab1138/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
----------------------------------------------------------------------
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala b/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
index 02afaa9..d0dd45d 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala
@@ -254,7 +254,7 @@ class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) extends
Seriali
    * Picks a random vertex from the graph and returns its ID.
    */
   def pickRandomVertex(): VertexId = {
-    val probability = 50 / graph.numVertices
+    val probability = 50.0 / graph.numVertices
     var found = false
     var retVal: VertexId = null.asInstanceOf[VertexId]
     while (!found) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message