Skip to content

Commit 95c7f67

Browse files
committed
Simplifying StorageLevel checks
1 parent 56f71cd commit 95c7f67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private[spark] class CacheManager(blockManager: BlockManager) extends Logging {
7171
val computedValues = rdd.computeOrReadCheckpoint(split, context)
7272
// Persist the result, so long as the task is not running locally
7373
if (context.runningLocally) { return computedValues }
74-
if (storageLevel == StorageLevel.DISK_ONLY || storageLevel == StorageLevel.DISK_ONLY_2) {
74+
if (storageLevel.useDisk || !storageLevel.useMemory) {
7575
blockManager.put(key, computedValues, storageLevel, tellMaster = true)
7676
return blockManager.get(key) match {
7777
case Some(values) =>

0 commit comments

Comments
 (0)