Skip to content
Snippets Groups Projects
Commit 80e73ed0 authored by Joseph E. Gonzalez's avatar Joseph E. Gonzalez
Browse files

Adding minimal additional functionality to EdgeRDD

parent 4bafc4f4
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,23 @@ class EdgeRDD[@specialized ED: ClassTag](
}, preservesPartitioning = true))
}
/**
* Map the values in an edge partitioning preserving the structure but changing the values.
*
* @tparam ED2 the new edge value type
* @param f the function from an edge to a new edge value
* @return a new EdgeRDD containing the new edge values
*/
def mapValues[ED2: ClassTag](f: Edge[ED] => ED2): EdgeRDD[ED2] =
mapEdgePartitions((pid, part) => part.map(f))
/**
* Reverse all the edges in this RDD.
*
* @return a new EdgeRDD containing all the edges reversed
*/
def reverse: EdgeRDD[ED] = mapEdgePartitions((pid, part) => part.reverse)
/**
* Inner joins this EdgeRDD with another EdgeRDD, assuming both are partitioned using the same
* [[PartitionStrategy]].
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment