From 4d05314ca204d3792de0411169ee4f4a5169594f Mon Sep 17 00:00:00 2001 From: Tathagata Das Date: Sun, 6 Apr 2014 21:09:55 -0700 Subject: [PATCH] Scala style fix. --- .../main/scala/org/apache/spark/ContextCleaner.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/ContextCleaner.scala b/core/src/main/scala/org/apache/spark/ContextCleaner.scala index 7cfd7cf06d33d..250d9d55c6211 100644 --- a/core/src/main/scala/org/apache/spark/ContextCleaner.scala +++ b/core/src/main/scala/org/apache/spark/ContextCleaner.scala @@ -63,8 +63,11 @@ private[spark] class ContextCleaner(sc: SparkContext) extends Logging { private val cleaningThread = new Thread() { override def run() { keepCleaning() }} - /** Whether the cleaning thread will block on cleanup tasks */ - private val blockOnCleanupTasks = sc.conf.getBoolean("spark.cleaner.referenceTracking.blocking", false) + /** + * Whether the cleaning thread will block on cleanup tasks. + * This is set to true only for tests. */ + private val blockOnCleanupTasks = sc.conf.getBoolean( + "spark.cleaner.referenceTracking.blocking", false) @volatile private var stopped = false @@ -170,7 +173,8 @@ private[spark] class ContextCleaner(sc: SparkContext) extends Logging { private def broadcastManager = sc.env.broadcastManager private def mapOutputTrackerMaster = sc.env.mapOutputTracker.asInstanceOf[MapOutputTrackerMaster] - // Used for testing, explicitly blocks until cleanup is completed + // Used for testing. These methods explicitly blocks until cleanup is completed + // to ensure that more reliable testing. def cleanupRDD(rdd: RDD[_]) { doCleanupRDD(rdd.id, blocking = true)