diff options
author | Ankur Dave <ankurdave@gmail.com> | 2014-01-13 13:16:41 -0800 |
---|---|---|
committer | Ankur Dave <ankurdave@gmail.com> | 2014-01-13 13:16:41 -0800 |
commit | 9fe88627b5716c6893a6d034fefcf530a6c470fa (patch) | |
tree | 8b74e17c4024bca4783aaceadf7f0aeea41dc300 /graphx | |
parent | ea69cff7110e4eaf4e92bc3f2f9d1e765f172b0e (diff) | |
download | spark-9fe88627b5716c6893a6d034fefcf530a6c470fa.tar.gz spark-9fe88627b5716c6893a6d034fefcf530a6c470fa.tar.bz2 spark-9fe88627b5716c6893a6d034fefcf530a6c470fa.zip |
Improve EdgeRDD scaladoc
Diffstat (limited to 'graphx')
-rw-r--r-- | graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala b/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala index 05d3dbe337..0269ed3cf3 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala @@ -49,7 +49,7 @@ class EdgeRDD[@specialized ED: ClassTag]( this } - def mapEdgePartitions[ED2: ClassTag](f: (PartitionID, EdgePartition[ED]) => EdgePartition[ED2]) + private[graphx] def mapEdgePartitions[ED2: ClassTag](f: (PartitionID, EdgePartition[ED]) => EdgePartition[ED2]) : EdgeRDD[ED2] = { new EdgeRDD[ED2](partitionsRDD.mapPartitions({ iter => val (pid, ep) = iter.next() @@ -57,6 +57,15 @@ class EdgeRDD[@specialized ED: ClassTag]( }, preservesPartitioning = true)) } + /** + * Inner joins this EdgeRDD with another EdgeRDD, assuming both are partitioned using the same + * [[PartitionStrategy]]. + * + * @param other the EdgeRDD to join with + * @param f the join function applied to corresponding values of `this` and `other` + * @return a new EdgeRDD containing only edges that appear in both `this` and `other`, with values + * supplied by `f` + */ def innerJoin[ED2: ClassTag, ED3: ClassTag] (other: EdgeRDD[ED2]) (f: (VertexID, VertexID, ED, ED2) => ED3): EdgeRDD[ED3] = { @@ -70,7 +79,7 @@ class EdgeRDD[@specialized ED: ClassTag]( }) } - def collectVertexIDs(): RDD[VertexID] = { + private[graphx] def collectVertexIDs(): RDD[VertexID] = { partitionsRDD.flatMap { case (_, p) => Array.concat(p.srcIds, p.dstIds) } } } |