Github user eatoncys commented on a diff in the pull request:
https://github.com/apache/spark/pull/17683#discussion_r112339699
--- 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 --
Ok, I have modified the disk case, and add a "update" style log info, any
other suggestions? thank you
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]