From 9fe88627b5716c6893a6d034fefcf530a6c470fa Mon Sep 17 00:00:00 2001 From: Ankur Dave Date: Mon, 13 Jan 2014 13:16:41 -0800 Subject: Improve EdgeRDD scaladoc --- graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'graphx') 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) } } } -- cgit v1.2.3