@@ -429,29 +429,10 @@ private[spark] class MemoryStore(blockManager: BlockManager, memoryManager: Memo
429
429
blockId : BlockId ,
430
430
space : Long ,
431
431
droppedBlocks : mutable.Buffer [(BlockId , BlockStatus )]): Boolean = {
432
- ensureFreeSpace(Some (blockId), space, droppedBlocks)
433
- }
434
-
435
- /**
436
- * Try to free up a given amount of space to store a particular block, but can fail if
437
- * either the block is bigger than our memory or it would require replacing another block
438
- * from the same RDD (which leads to a wasteful cyclic replacement pattern for RDDs that
439
- * don't fit into memory that we want to avoid).
440
- *
441
- * @param blockId the ID of the block we are freeing space for, if any
442
- * @param space the size of this block
443
- * @param droppedBlocks a holder for blocks evicted in the process
444
- * @return whether the requested free space is freed.
445
- */
446
- private def ensureFreeSpace (
447
- blockId : Option [BlockId ],
448
- space : Long ,
449
- droppedBlocks : mutable.Buffer [(BlockId , BlockStatus )]): Boolean = {
450
432
memoryManager.synchronized {
451
433
val freeMemory = maxMemory - memoryUsed
452
434
453
- logInfo(s " Ensuring $space bytes of free space " +
454
- blockId.map { id => s " for block $id" }.getOrElse(" " ) +
435
+ logInfo(s " Ensuring $space bytes of free space for block $blockId" +
455
436
s " (free: $freeMemory, max: $maxMemory) " )
456
437
457
438
assert(space <= maxMemory)
@@ -461,7 +442,7 @@ private[spark] class MemoryStore(blockManager: BlockManager, memoryManager: Memo
461
442
true
462
443
} else {
463
444
// Evict blocks as necessary
464
- evictBlocksToFreeSpace(blockId, freeMemory - space, droppedBlocks)
445
+ evictBlocksToFreeSpace(Some ( blockId) , freeMemory - space, droppedBlocks)
465
446
}
466
447
}
467
448
}
0 commit comments