From 6ab1db8071101a097a3508861aaa12550a5bf9d5 Mon Sep 17 00:00:00 2001 From: walker Date: Tue, 7 Jan 2014 01:21:25 +0800 Subject: [PATCH] add inline comments --- .../org/apache/spark/storage/BlockManagerMasterActor.scala | 4 ++++ 1 file changed, 4 insertions(+) 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 52a424db22..a028783757 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