Make Graph{,Impl,Ops} serializable to work around capture

This commit is contained in:
Ankur Dave 2014-01-13 20:59:45 -08:00
parent d4d9ece1af
commit 84d6af8021
3 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ import org.apache.spark.storage.StorageLevel
* @tparam VD the vertex attribute type
* @tparam ED the edge attribute type
*/
abstract class Graph[VD: ClassTag, ED: ClassTag] {
abstract class Graph[VD: ClassTag, ED: ClassTag] protected () extends Serializable {
/**
* An RDD containing the vertices and their associated attributes.

View file

@ -14,7 +14,7 @@ import org.apache.spark.rdd.RDD
* @tparam VD the vertex attribute type
* @tparam ED the edge attribute type
*/
class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) {
class GraphOps[VD: ClassTag, ED: ClassTag](graph: Graph[VD, ED]) extends Serializable {
/** The number of edges in the graph. */
lazy val numEdges: Long = graph.edges.count()

View file

@ -32,7 +32,7 @@ class GraphImpl[VD: ClassTag, ED: ClassTag] protected (
@transient val replicatedVertexView: ReplicatedVertexView[VD])
extends Graph[VD, ED] with Serializable {
/** Default construct is provided to support serialization */
/** Default constructor is provided to support serialization */
protected def this() = this(null, null, null, null)
/** Return a RDD that brings edges together with their source and destination vertices. */