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

    https://github.com/apache/spark/pull/9478#discussion_r44488058
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/FileShuffleBlockResolver.scala ---
    @@ -107,8 +107,13 @@ private[spark] class FileShuffleBlockResolver(conf: 
SparkConf)
         }
       }
     
    -  override def getBlockData(blockId: ShuffleBlockId): ManagedBuffer = {
    -    val file = blockManager.diskBlockManager.getFile(blockId)
    +  override def getBlockData(blockId: ShuffleBlockId, blockManagerId: 
BlockManagerId)
    +    : ManagedBuffer = {
    +    val file = if (blockManager.blockManagerId != blockManagerId) {
    +      
blockManager.diskBlockManager.getShuffleFileBypassNetworkAccess(blockId, 
blockManagerId)
    --- End diff --
    
    This seems like the wrong abstraction. Ideally we should just call 
`diskBlockManager.getFile(blockId, blockManagerId)` and it will take care of 
the rest for us. We shouldn't expose the details of how the shuffle files are 
retrieved here. i.e. I would just do this:
    ```
    override def getBlockData(
        blockId: ShuffleBlockId,
        blockManagerId: BlockManagerId): ManagedBuffer = {
      val file = blockManager.diskBlockManager.getFile(blockId, blockManagerId)
      ...
    }
    ```


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