squito commented on a change in pull request #25299: [SPARK-27651][Core] Avoid 
the network when shuffle blocks are fetched from the same host
URL: https://github.com/apache/spark/pull/25299#discussion_r313070274
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
 ##########
 @@ -358,12 +377,45 @@ final class ShuffleBlockFetcherIterator(
     }
   }
 
+
+  /**
+   * Fetch the host-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 fetchHostLocalBlocks() {
+    logDebug(s"Start fetching host-local blocks: ${hostLocalBlocks.mkString(", 
")}")
+
+    val localDirsByExec = 
blockManager.getHostLocalDirs(hostLocalBlocksByExecutor.keySet.toArray)
+    for (
+      (execId, blocks) <- hostLocalBlocksByExecutor;
+      localDirs = localDirsByExec(execId);
+      blockId <- blocks
 
 Review comment:
   probably stating the obvious, but when you do change it so that the driver 
does not store an unbounded set of local dirs, then you'll have to do some 
error handling here to make sure you go back to doing a remote read.  worth a 
test case too

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to