spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srowen <...@git.apache.org>
Subject [GitHub] spark pull request #17683: [SPARK-20386][Spark Core]modify the log info if t...
Date Wed, 19 Apr 2017 12:16:50 GMT
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17683#discussion_r112185112
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
---
    @@ -520,8 +520,18 @@ private[spark] class BlockManagerInfo(
             blockStatus = BlockStatus(storageLevel, memSize = memSize, diskSize = 0)
             _blocks.put(blockId, blockStatus)
             _remainingMem -= memSize
    -        logInfo("Added %s in memory on %s (size: %s, free: %s)".format(
    -          blockId, blockManagerId.hostPort, Utils.bytesToString(memSize),
    +        val originalMemSize = if (_blocks.containsKey(blockId)) {
    +          _blocks.get(blockId).memSize
    +        }  else {
    +          0
    +        }
    +        val (addedOrRemoved, size) = if (memSize >= originalMemSize) {
    +          ("Added", memSize - originalMemSize)
    +        } else {
    +          ("Removed", originalMemSize - memSize)
    +        }
    +        logInfo("%s %s in memory on %s (size: %s, free: %s)".format(
    +          addedOrRemoved, blockId, blockManagerId.hostPort, Utils.bytesToString(size),
               Utils.bytesToString(_remainingMem)))
           }
           if (storageLevel.useDisk) {
    --- End diff --
    
    Doesn't the disk case need a similar treatment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message