diff options
author | Mike <wannabeast@users.noreply.github.com> | 2013-09-11 18:01:19 -0700 |
---|---|---|
committer | Mike <wannabeast@users.noreply.github.com> | 2013-09-11 18:01:19 -0700 |
commit | d34672f6684d2c14fc5db58335370ef9ba84375e (patch) | |
tree | 3aae945e9e88848659ed014d034e58c933736bf2 /core/src/main | |
parent | 293c758cc00b51786293158da4870c669f416a7f (diff) | |
download | spark-d34672f6684d2c14fc5db58335370ef9ba84375e.tar.gz spark-d34672f6684d2c14fc5db58335370ef9ba84375e.tar.bz2 spark-d34672f6684d2c14fc5db58335370ef9ba84375e.zip |
Set currentMemory to 0 in clear().
Remove unnecessary entries.get() call.
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/scala/org/apache/spark/storage/MemoryStore.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala b/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala index c465a9ad6c..4344f851d9 100644 --- a/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala +++ b/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala @@ -110,9 +110,8 @@ private class MemoryStore(blockManager: BlockManager, maxMemory: Long) override def remove(blockId: String): Boolean = { entries.synchronized { - val entry = entries.get(blockId) + val entry = entries.remove(blockId) if (entry != null) { - entries.remove(blockId) currentMemory -= entry.size logInfo("Block %s of size %d dropped from memory (free %d)".format( blockId, entry.size, freeMemory)) @@ -126,6 +125,7 @@ private class MemoryStore(blockManager: BlockManager, maxMemory: Long) override def clear() { entries.synchronized { entries.clear() + currentMemory = 0 } logInfo("MemoryStore cleared") } |