@@ -32,10 +32,14 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
3232 private val loading = new HashSet [RDDBlockId ]()
3333
3434 /** Gets or computes an RDD split. Used by RDD.iterator() when an RDD is cached. */
35- def getOrCompute [T ](rdd : RDD [T ], split : Partition , context : TaskContext ,
35+ def getOrCompute [T ](
36+ rdd : RDD [T ],
37+ split : Partition ,
38+ context : TaskContext ,
3639 storageLevel : StorageLevel ): Iterator [T ] = {
40+
3741 val key = RDDBlockId (rdd.id, split.index)
38- logDebug(" Looking for partition " + key)
42+ logDebug(s " Looking for partition $ key" )
3943 blockManager.get(key) match {
4044 case Some (values) =>
4145 // Partition is already materialized, so just return its values
@@ -45,7 +49,7 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
4549 // Mark the split as loading (unless someone else marks it first)
4650 loading.synchronized {
4751 if (loading.contains(key)) {
48- logInfo(" Another thread is loading %s , waiting for it to finish..." .format(key) )
52+ logInfo(s " Another thread is loading $key , waiting for it to finish... " )
4953 while (loading.contains(key)) {
5054 try {
5155 loading.wait()
@@ -54,7 +58,7 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
5458 logWarning(s " Got an exception while waiting for another thread to load $key" , e)
5559 }
5660 }
57- logInfo(" Finished waiting for %s " .format( key) )
61+ logInfo(s " Finished waiting for $ key" )
5862 /* See whether someone else has successfully loaded it. The main way this would fail
5963 * is for the RDD-level cache eviction policy if someone else has loaded the same RDD
6064 * partition but we didn't want to make space for it. However, that case is unlikely
@@ -64,7 +68,7 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
6468 case Some (values) =>
6569 return new InterruptibleIterator (context, values.asInstanceOf [Iterator [T ]])
6670 case None =>
67- logInfo(" Whoever was loading %s failed; we'll try it ourselves" .format(key) )
71+ logInfo(s " Whoever was loading $key failed; we'll try it ourselves " )
6872 loading.add(key)
6973 }
7074 } else {
@@ -73,7 +77,7 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
7377 }
7478 try {
7579 // If we got here, we have to load the split
76- logInfo(" Partition %s not found, computing it" .format(key) )
80+ logInfo(s " Partition $key not found, computing it " )
7781 val computedValues = rdd.computeOrReadCheckpoint(split, context)
7882
7983 // Persist the result, so long as the task is not running locally
@@ -97,8 +101,8 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
97101 case Some (values) =>
98102 values.asInstanceOf [Iterator [T ]]
99103 case None =>
100- logInfo(" Failure to store %s " .format( key) )
101- throw new Exception (" Block manager failed to return persisted valued " )
104+ logInfo(s " Failure to store $ key" )
105+ throw new SparkException (" Block manager failed to return persisted value " )
102106 }
103107 } else {
104108 // In this case the RDD is cached to an array buffer. This will save the results
0 commit comments