File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
core/src/main/scala/org/apache/spark/rdd Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,16 @@ abstract class RDD[T: ClassTag](
285285 */
286286 private [spark] def withScope [U ](body : => U ): U = RDDOperationScope .withScope[U ](sc)(body)
287287
288+ /**
289+ * Execute a block of code in a scope such that all new RDDs created in this body will
290+ * be part of the same scope. For more detail, see {{org.apache.spark.rdd.RDDOperationScope}}.
291+ *
292+ * Note: Return statements are NOT allowed in the given body.
293+ */
294+ private [spark] def withNamedScope [U ](scopeName : String )(body : => U ): U = {
295+ RDDOperationScope .withScope[U ](sc)(body)
296+ }
297+
288298 // Transformations (return a new RDD)
289299
290300 /**
@@ -1512,7 +1522,7 @@ abstract class RDD[T: ClassTag](
15121522 * has completed (therefore the RDD has been materialized and potentially stored in memory).
15131523 * doCheckpoint() is called recursively on the parent RDDs.
15141524 */
1515- private [spark] def doCheckpoint () {
1525+ private [spark] def doCheckpoint (): Unit = withNamedScope( " checkpoint " ) {
15161526 if (! doCheckpointCalled) {
15171527 doCheckpointCalled = true
15181528 if (checkpointData.isDefined) {
You can’t perform that action at this time.
0 commit comments