diff options
author | CrazyJvm <crazyjvm@gmail.com> | 2014-07-22 18:14:44 -0700 |
---|---|---|
committer | Ankur Dave <ankurdave@gmail.com> | 2014-07-22 18:14:44 -0700 |
commit | 5f7b99168004f06191dcf121fe985e90bf7dcf74 (patch) | |
tree | 9390fbb3313d752c71db7ccf0da5adeee34e1bdf /graphx/src/main/scala | |
parent | 79fe7634f6817eb2443bc152c6790a4439721fda (diff) | |
download | spark-5f7b99168004f06191dcf121fe985e90bf7dcf74.tar.gz spark-5f7b99168004f06191dcf121fe985e90bf7dcf74.tar.bz2 spark-5f7b99168004f06191dcf121fe985e90bf7dcf74.zip |
Graphx example
fix examples
Author: CrazyJvm <crazyjvm@gmail.com>
Closes #1523 from CrazyJvm/graphx-example and squashes the following commits:
663457a [CrazyJvm] outDegrees does not take parameters
7cfff1d [CrazyJvm] fix example for joinVertices
Diffstat (limited to 'graphx/src/main/scala')
-rw-r--r-- | graphx/src/main/scala/org/apache/spark/graphx/Graph.scala | 2 | ||||
-rw-r--r-- | graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/Graph.scala b/graphx/src/main/scala/org/apache/spark/graphx/Graph.scala index 3507f358bf..fa4b891754 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/Graph.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/Graph.scala @@ -344,7 +344,7 @@ abstract class Graph[VD: ClassTag, ED: ClassTag] protected () extends Serializab * * {{{ * val rawGraph: Graph[_, _] = Graph.textFile("webgraph") - * val outDeg: RDD[(VertexId, Int)] = rawGraph.outDegrees() + * val outDeg: RDD[(VertexId, Int)] = rawGraph.outDegrees * val graph = rawGraph.outerJoinVertices(outDeg) { * (vid, data, optDeg) => optDeg.getOrElse(0) * } 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 edd5b79da1..02afaa987d 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala @@ -198,10 +198,10 @@ class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) extends Seriali * * {{{ * val rawGraph: Graph[Int, Int] = GraphLoader.edgeListFile(sc, "webgraph") - * .mapVertices(v => 0) - * val outDeg: RDD[(Int, Int)] = rawGraph.outDegrees - * val graph = rawGraph.leftJoinVertices[Int,Int](outDeg, - * (v, deg) => deg ) + * .mapVertices((_, _) => 0) + * val outDeg = rawGraph.outDegrees + * val graph = rawGraph.joinVertices[Int](outDeg) + * ((_, _, outDeg) => outDeg) * }}} * */ |