You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/01/10 03:46:52 UTC
[3/6] git commit: add inline comments
add inline comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/6ab1db80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/6ab1db80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/6ab1db80
Branch: refs/heads/master
Commit: 6ab1db8071101a097a3508861aaa12550a5bf9d5
Parents: a0c6d96
Author: walker <walker@transwarp01.(none)>
Authored: Tue Jan 7 01:21:25 2014 +0800
Committer: walker <walker@transwarp01.(none)>
Committed: Tue Jan 7 01:21:25 2014 +0800
----------------------------------------------------------------------
.../scala/org/apache/spark/storage/BlockManagerMasterActor.scala | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/6ab1db80/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala b/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala
index 52a424d..a028783 100644
--- a/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala
+++ b/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala
@@ -348,6 +348,10 @@ object BlockManagerMasterActor {
if (storageLevel.isValid) {
// isValid means it is either stored in-memory or on-disk.
+ // But the memSize here indicates the data size in or dropped from memory,
+ // and the diskSize here indicates the data size in or dropped to disk.
+ // They can be both large than 0, when a block is dropped from memory to disk.
+ // Therefore, a safe way to set BlockStatus is to set its info in accurate modes.
if (storageLevel.useMemory) {
_blocks.put(blockId, BlockStatus(storageLevel, memSize, 0))
_remainingMem -= memSize