Skip to content

Commit a430f06

Browse files
committed
Fixed compilation errors.
1 parent b27f8e8 commit a430f06

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/src/main/scala/org/apache/spark/Dependency.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ShuffleDependency[K, V](
5656

5757
val shuffleId: Int = rdd.context.newShuffleId()
5858

59-
rdd.sparkContext.cleaner.registerShuffleForCleanup(this)
59+
rdd.sparkContext.cleaner.foreach(_.registerShuffleForCleanup(this))
6060
}
6161

6262

core/src/main/scala/org/apache/spark/rdd/RDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ abstract class RDD[T: ClassTag](
139139
}
140140
sc.persistRDD(this)
141141
// Register the RDD with the ContextCleaner for automatic GC-based cleanup
142-
sc.cleaner.registerRDDForCleanup(this)
142+
sc.cleaner.foreach(_.registerRDDForCleanup(this))
143143
storageLevel = newLevel
144144
this
145145
}

core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class ContextCleanerSuite extends FunSuite with BeforeAndAfter with LocalSparkCo
197197
}
198198
}
199199

200-
def cleaner = sc.cleaner
200+
def cleaner = sc.cleaner.get
201201
}
202202

203203

@@ -235,7 +235,7 @@ class CleanerTester(
235235

236236
logInfo("Attempting to validate before cleanup:\n" + uncleanedResourcesToString)
237237
preCleanupValidate()
238-
sc.cleaner.attachListener(cleanerListener)
238+
sc.cleaner.get.attachListener(cleanerListener)
239239

240240
/** Assert that all the stuff has been cleaned up */
241241
def assertCleanup()(implicit waitTimeout: Eventually.Timeout) {

0 commit comments

Comments
 (0)