Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17683#discussion_r112183943
  
    --- 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) {
    --- End diff --
    
    The difference doesn't need to be conditional. You can use `math.abs`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to