diff options
author | Ankur Dave <ankurdave@gmail.com> | 2014-04-16 17:15:50 -0700 |
---|---|---|
committer | Reynold Xin <rxin@apache.org> | 2014-04-16 17:15:50 -0700 |
commit | 235a47ce14b3c7523e79ce671355dea7ee06f4b7 (patch) | |
tree | 977ccb414412c02f1934816cadd9061c84662046 /graphx/src/main | |
parent | 987760ec0aa914995b742b234fc8663b74f5476f (diff) | |
download | spark-235a47ce14b3c7523e79ce671355dea7ee06f4b7.tar.gz spark-235a47ce14b3c7523e79ce671355dea7ee06f4b7.tar.bz2 spark-235a47ce14b3c7523e79ce671355dea7ee06f4b7.zip |
Rebuild routing table after Graph.reverse
GraphImpl.reverse used to reverse edges in each partition of the edge RDD but preserve the routing table and replicated vertex view, since reversing should not affect partitioning.
However, the old routing table would then have incorrect information for srcAttrOnly and dstAttrOnly. These RDDs should be switched.
A simple fix is for Graph.reverse to rebuild the routing table and replicated vertex view.
Thanks to Bogdan Ghidireac for reporting this issue on the [mailing list](http://apache-spark-user-list.1001560.n3.nabble.com/graph-reverse-amp-Pregel-API-td4338.html).
Author: Ankur Dave <ankurdave@gmail.com>
Closes #431 from ankurdave/fix-reverse-bug and squashes the following commits:
75d63cb [Ankur Dave] Rebuild routing table after Graph.reverse
Diffstat (limited to 'graphx/src/main')
-rw-r--r-- | graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala b/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala index c2b510a31e..9eabccdee4 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala @@ -102,7 +102,7 @@ class GraphImpl[VD: ClassTag, ED: ClassTag] protected ( override def reverse: Graph[VD, ED] = { val newETable = edges.mapEdgePartitions((pid, part) => part.reverse) - new GraphImpl(vertices, newETable, routingTable, replicatedVertexView) + GraphImpl(vertices, newETable) } override def mapVertices[VD2: ClassTag](f: (VertexId, VD) => VD2): Graph[VD2, ED] = { |