-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20386][Spark Core]modify the log info if the block exists on the slave already #17683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
312b90b
2d95652
22ef469
c14b1ad
b769754
81e8e84
567a9ae
f7e40b8
60ca9e0
664dfb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't the disk case need a similar treatment?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I have modified the disk case, and add a "update" style log info, any other suggestions? thank you |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it's not a Scala Map or else this could be
.getOrElse(..., 0). Now I understand why you pulled out the variable earlier. I actually dont' think this works now because it happens after the new status has been put in the Map. OK, you could go back to what you had.