Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/rdd/RDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ abstract class RDD[T: ClassTag](
* doCheckpoint() is called recursively on the parent RDDs.
*/
private[spark] def doCheckpoint(): Unit = {
RDDOperationScope.withScope(sc, "checkpoint", false, true) {
RDDOperationScope.withScope(sc, "checkpoint", allowNesting = false, ignoreParent = true) {
if (!doCheckpointCalled) {
doCheckpointCalled = true
if (checkpointData.isDefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private[spark] object RDDOperationScope {
sc: SparkContext,
allowNesting: Boolean = false)(body: => T): T = {
val callerMethodName = Thread.currentThread.getStackTrace()(3).getMethodName
withScope[T](sc, callerMethodName, allowNesting)(body)
withScope[T](sc, callerMethodName, allowNesting, ignoreParent = false)(body)
}

/**
Expand All @@ -116,7 +116,7 @@ private[spark] object RDDOperationScope {
sc: SparkContext,
name: String,
allowNesting: Boolean,
ignoreParent: Boolean = false)(body: => T): T = {
ignoreParent: Boolean)(body: => T): T = {
// Save the old scope to restore it later
val scopeKey = SparkContext.RDD_SCOPE_KEY
val noOverrideKey = SparkContext.RDD_SCOPE_NO_OVERRIDE_KEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class RDDOperationScopeSuite extends FunSuite with BeforeAndAfter {
var rdd1: MyCoolRDD = null
var rdd2: MyCoolRDD = null
var rdd3: MyCoolRDD = null
RDDOperationScope.withScope(sc, "scope1", allowNesting = false) {
RDDOperationScope.withScope(sc, "scope1", allowNesting = false, ignoreParent = false) {
rdd1 = new MyCoolRDD(sc)
RDDOperationScope.withScope(sc, "scope2", allowNesting = false) {
RDDOperationScope.withScope(sc, "scope2", allowNesting = false, ignoreParent = false) {
rdd2 = new MyCoolRDD(sc)
RDDOperationScope.withScope(sc, "scope3", allowNesting = false) {
RDDOperationScope.withScope(sc, "scope3", allowNesting = false, ignoreParent = false) {
rdd3 = new MyCoolRDD(sc)
}
}
Expand All @@ -84,11 +84,13 @@ class RDDOperationScopeSuite extends FunSuite with BeforeAndAfter {
var rdd1: MyCoolRDD = null
var rdd2: MyCoolRDD = null
var rdd3: MyCoolRDD = null
RDDOperationScope.withScope(sc, "scope1", allowNesting = true) { // allow nesting here
// allow nesting here
RDDOperationScope.withScope(sc, "scope1", allowNesting = true, ignoreParent = false) {
rdd1 = new MyCoolRDD(sc)
RDDOperationScope.withScope(sc, "scope2", allowNesting = false) { // stop nesting here
// stop nesting here
RDDOperationScope.withScope(sc, "scope2", allowNesting = false, ignoreParent = false) {
rdd2 = new MyCoolRDD(sc)
RDDOperationScope.withScope(sc, "scope3", allowNesting = false) {
RDDOperationScope.withScope(sc, "scope3", allowNesting = false, ignoreParent = false) {
rdd3 = new MyCoolRDD(sc)
}
}
Expand All @@ -107,11 +109,11 @@ class RDDOperationScopeSuite extends FunSuite with BeforeAndAfter {
var rdd1: MyCoolRDD = null
var rdd2: MyCoolRDD = null
var rdd3: MyCoolRDD = null
RDDOperationScope.withScope(sc, "scope1", allowNesting = true) {
RDDOperationScope.withScope(sc, "scope1", allowNesting = true, ignoreParent = false) {
rdd1 = new MyCoolRDD(sc)
RDDOperationScope.withScope(sc, "scope2", allowNesting = true) {
RDDOperationScope.withScope(sc, "scope2", allowNesting = true, ignoreParent = false) {
rdd2 = new MyCoolRDD(sc)
RDDOperationScope.withScope(sc, "scope3", allowNesting = true) {
RDDOperationScope.withScope(sc, "scope3", allowNesting = true, ignoreParent = false) {
rdd3 = new MyCoolRDD(sc)
}
}
Expand Down