spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewor14 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-6521][Core] Bypass unnecessary network ...
Date Wed, 11 Nov 2015 00:39:19 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message