From 3be5d6a6f6285c6276d80210bf477c483c09c2f9 Mon Sep 17 00:00:00 2001 From: bxshi Date: Sun, 22 Jun 2014 16:39:52 -0400 Subject: [PATCH 1/2] add a materialize method to materialize VertexRDD by calling RDD's count method --- .../src/main/scala/org/apache/spark/graphx/VertexRDD.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala b/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala index f1b6df9a3025e..556f7ff30ea45 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala @@ -111,6 +111,11 @@ class VertexRDD[@specialized VD: ClassTag]( partitionsRDD.map(_.size).reduce(_ + _) } + /** Materialize vertices by calling RDD's count method */ + def materialize(): Long = { + super.count() + } + /** * Provides the `RDD[(VertexId, VD)]` equivalent output. */ From f1ed7f3932e34b396b114bbfa78a357a199a6237 Mon Sep 17 00:00:00 2001 From: bxshi Date: Mon, 23 Jun 2014 18:55:24 -0400 Subject: [PATCH 2/2] fix SPARK-2245 delegate checkpoint related method to partitionsRDD --- .../scala/org/apache/spark/graphx/VertexRDD.scala | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala b/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala index 556f7ff30ea45..f0f41b692fa86 100644 --- a/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala +++ b/graphx/src/main/scala/org/apache/spark/graphx/VertexRDD.scala @@ -111,9 +111,16 @@ class VertexRDD[@specialized VD: ClassTag]( partitionsRDD.map(_.size).reduce(_ + _) } - /** Materialize vertices by calling RDD's count method */ - def materialize(): Long = { - super.count() + override def checkpoint() { + partitionsRDD.checkpoint() + } + + override def getCheckpointFile: Option[String] = { + partitionsRDD.getCheckpointFile + } + + override def isCheckpointed: Boolean = { + partitionsRDD.isCheckpointed } /**