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

    https://github.com/apache/spark/pull/2330#discussion_r17459366
  
    --- Diff: 
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala 
---
    @@ -185,26 +223,34 @@ final class ShuffleBlockFetcherIterator(
         remoteRequests
       }
     
    +  /**
    +   * Fetch the local blocks while we are fetching remote blocks. This is 
ok because
    +   * [[ManagedBuffer]]'s memory is allocated lazily when we create the 
input stream, so all we
    +   * track in-memory are the ManagedBuffer references themselves.
    +   */
       private[this] def fetchLocalBlocks() {
    -    // Get the local blocks while remote blocks are being fetched. Note 
that it's okay to do
    -    // these all at once because they will just memory-map some files, so 
they won't consume
    -    // any memory that might exceed our maxBytesInFlight
    -    for (id <- localBlocks) {
    +    val iter = localBlocks.iterator
    +    while (iter.hasNext) {
    +      val blockId = iter.next()
           try {
    +        val buf = blockManager.getBlockData(blockId.toString)
             shuffleMetrics.localBlocksFetched += 1
    -        results.put(new FetchResult(
    -          id, 0, () => blockManager.getLocalShuffleFromDisk(id, 
serializer).get))
    -        logDebug("Got local block " + id)
    --- End diff --
    
    Then, looks like that no one else is using 
blockManager.getLocalShuffleFromDisk, could be removed.


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