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

    https://github.com/apache/spark/pull/2844#discussion_r19063222
  
    --- Diff: 
core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala ---
    @@ -76,23 +87,20 @@ private[spark] class TorrentBroadcast[T: ClassTag](
        * @return number of blocks this broadcast variable is divided into
        */
       private def writeBlocks(): Int = {
    -    // For local mode, just put the object in the BlockManager so we can 
find it later.
    -    SparkEnv.get.blockManager.putSingle(
    -      broadcastId, _value, StorageLevel.MEMORY_AND_DISK, tellMaster = 
false)
    -
    -    if (!isLocal) {
    -      val blocks = TorrentBroadcast.blockifyObject(_value)
    -      blocks.zipWithIndex.foreach { case (block, i) =>
    -        SparkEnv.get.blockManager.putBytes(
    -          BroadcastBlockId(id, "piece" + i),
    -          block,
    -          StorageLevel.MEMORY_AND_DISK_SER,
    -          tellMaster = true)
    -      }
    -      blocks.length
    -    } else {
    -      0
    +    // Store a copy of the broadcast variable in the driver so that tasks 
run on the driver
    +    // do not create a duplicate copy of the broadcast variable's value.
    +    SparkEnv.get.blockManager.putSingle(broadcastId, _value, 
StorageLevel.MEMORY_AND_DISK,
    +      tellMaster = false)
    --- End diff --
    
    I wonder that store a serialized copy in local mode will not help anything. 
If it failed to fetch the original copy of value from blockManager, it will 
also can not fetch the serialized copy.


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