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

    https://github.com/apache/spark/pull/10705#discussion_r53589538
  
    --- Diff: 
core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala ---
    @@ -127,16 +127,23 @@ private[spark] class TorrentBroadcast[T: 
ClassTag](obj: T, id: Long)
           def getRemote: Option[ByteBuffer] = bm.getRemoteBytes(pieceId).map { 
block =>
             // If we found the block from remote executors/driver's 
BlockManager, put the block
             // in this executor's BlockManager.
    -        SparkEnv.get.blockManager.putBytes(
    -          pieceId,
    -          block,
    -          StorageLevel.MEMORY_AND_DISK_SER,
    -          tellMaster = true)
    +        bm.putBytes(pieceId, block, StorageLevel.MEMORY_AND_DISK_SER, 
tellMaster = true)
             block
           }
           val block: ByteBuffer = getLocal.orElse(getRemote).getOrElse(
             throw new SparkException(s"Failed to get $pieceId of 
$broadcastId"))
           blocks(pid) = block
    +      Option(TaskContext.get()) match {
    --- End diff --
    
    Could you add a util method for these codes? I saw they appear multiple 
times.


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