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

    https://github.com/apache/spark/pull/4510#discussion_r24450007
  
    --- Diff: 
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala 
---
    @@ -189,6 +189,7 @@ final class ShuffleBlockFetcherIterator(
             // Filter out zero-sized blocks
             localBlocks ++= blockInfos.filter(_._2 != 0).map(_._1)
             numBlocksToFetch += localBlocks.size
    +        shuffleMetrics.incLocalBytesRead(blockInfos.map(_._2).sum)
    --- End diff --
    
    Is there a reason you are not incrementing the localBytesRead in 
fetchLocalBlocks right after the localBlocks are incremented?
    Looking at the initialization code, i don't really think there is much 
difference in functionality but it might be easier to understand to have both:
    shuffleMetrics.incLocalBlocksFetched(1)
    shuffleMetrics.incLocalBytesRead(buf.size)
    be together. Also, if they are together there is less chance of them later 
being calculated at different times. (if we want to add more parallelism for 
example). 
    



---
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]

Reply via email to