Skip to content
Snippets Groups Projects
Commit 84d6af80 authored by Ankur Dave's avatar Ankur Dave
Browse files

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

parent d4d9ece1
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
......@@ -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()
......
......@@ -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. */
......
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