Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up public API
  • Loading branch information
ankurdave committed Apr 23, 2014
commit 10b35969a24ff429b946b2f0384fa6eccd22d865
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] =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private[graphx]

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]
}