Skip to content

Commit

Permalink
Clean up public API
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurdave committed Apr 23, 2014
1 parent ae36110 commit 10b3596
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion graphx/src/main/scala/org/apache/spark/graphx/EdgeRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.apache.spark.graphx.impl.EdgePartition
* `EdgeRDD[ED, VD]` extends `RDD[Edge[ED]]` by storing the edges in columnar format on each
* partition for performance. It may additionally store the vertex attributes associated with each
* edge to provide the triplet view. Shipping of the vertex attributes is managed by
* [[org.apache.spark.graphx.impl.ReplicatedVertexView]].
* `impl.ReplicatedVertexView`.
*/
class EdgeRDD[@specialized ED: ClassTag, VD: ClassTag](
val partitionsRDD: RDD[(PartitionID, EdgePartition[ED, VD])])
Expand Down Expand Up @@ -103,6 +103,7 @@ class EdgeRDD[@specialized ED: ClassTag, VD: ClassTag](
*/
def reverse: EdgeRDD[ED, VD] = mapEdgePartitions((pid, part) => part.reverse)

/** Removes all edges but those matching `epred` and where both vertices match `vpred`. */
def filter(
epred: EdgeTriplet[VD, ED] => Boolean,
vpred: (VertexId, VD) => Boolean): EdgeRDD[ED, VD] = {
Expand Down
4 changes: 4 additions & 0 deletions graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ class VertexRDD[@specialized VD: ClassTag](
new VertexRDD[VD2](parts)
}

/**
* Returns a new `VertexRDD` reflecting a reversal of all edge directions in the corresponding
* [[EdgeRDD]].
*/
def reverseRoutingTables(): VertexRDD[VD] =
this.mapVertexPartitions(vPart => vPart.withRoutingTable(vPart.routingTable.reverse))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ private[graphx] abstract class VertexPartitionBase[@specialized(Long, Int, Doubl
}

/**
* A typeclass for subclasses of [[VertexPartitionBase]] representing the ability to wrap them in a
* A typeclass for subclasses of `VertexPartitionBase` representing the ability to wrap them in a
* `VertexPartitionBaseOps`.
*/
trait VertexPartitionBaseOpsConstructor[T[X] <: VertexPartitionBase[X]] {
private[graphx] trait VertexPartitionBaseOpsConstructor[T[X] <: VertexPartitionBase[X]] {
def toOps[VD: ClassTag](partition: T[VD]): VertexPartitionBaseOps[VD, T]
}

0 comments on commit 10b3596

Please sign in to comment.