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

    https://github.com/apache/spark/pull/6423#discussion_r32070536
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/hash/BlockStoreShuffleFetcher.scala
 ---
    @@ -78,21 +77,13 @@ private[hash] object BlockStoreShuffleFetcher extends 
Logging {
           SparkEnv.get.blockManager.shuffleClient,
           blockManager,
           blocksByAddress,
    -      serializer,
           // Note: we use getSizeAsMb when no suffix is provided for backwards 
compatibility
           SparkEnv.get.conf.getSizeAsMb("spark.reducer.maxSizeInFlight", 
"48m") * 1024 * 1024)
    -    val itr = blockFetcherItr.flatMap(unpackBlock)
     
    -    val completionIter = CompletionIterator[T, Iterator[T]](itr, {
    -      context.taskMetrics.updateShuffleReadMetrics()
    -    })
    +    val itr = blockFetcherItr.map(unpackBlock)
     
    -    new InterruptibleIterator[T](context, completionIter) {
    -      val readMetrics = 
context.taskMetrics.createShuffleReadMetricsForDependency()
    -      override def next(): T = {
    -        readMetrics.incRecordsRead(1)
    -        delegate.next()
    -      }
    -    }
    +    CompletionIterator[(BlockId, InputStream), Iterator[(BlockId, 
InputStream)]](itr, {
    +      context.taskMetrics().updateShuffleReadMetrics()
    --- End diff --
    
    Since the creation of the iterator that updates the shuffle records has 
been moved to HashShuffleReader, can you move this to be there as well? As-is, 
it's hard from reading the code to understand why the shuffle read metrics 
should be updated here.


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