Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bug fix, and addressed PR comments from @mridulm
Fixed bug: getRddId(blockId) returns an Option[Int], which never equals to rddId: Int.
  • Loading branch information
liancheng committed Mar 7, 2014
commit 40cdcb2334dc1d66194a1516e7ec998908b7cc78
13 changes: 5 additions & 8 deletions core/src/main/scala/org/apache/spark/storage/MemoryStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,9 @@ private class MemoryStore(blockManager: BlockManager, maxMemory: Long)
// accessed RDD, unless this is the same RDD as the one with the
// new partition. In that case, we keep the old partition in memory
// to prevent cycling partitions from the same RDD in and out.
//
// TODO implement LRU eviction
rddToAdd match {
case Some(rddId) if rddId == getRddId(blockId) =>
// no-op
case _ =>
selectedBlocks += blockId
selectedMemory += pair.getValue.size
if (rddToAdd.isEmpty || rddToAdd != getRddId(blockId)) {
selectedBlocks += blockId
selectedMemory += pair.getValue.size
}
}
}
Expand All @@ -274,6 +269,8 @@ private class MemoryStore(blockManager: BlockManager, maxMemory: Long)
}
return true
} else {
logInfo(s"Will not store $blockIdToAdd as it would require dropping another block " +
"from the same RDD")
return false
}
}
Expand Down