@@ -54,8 +54,6 @@ private[spark] class TorrentBroadcast[T: ClassTag](
54
54
id : Long )
55
55
extends Broadcast [T ](id) with Logging with Serializable {
56
56
57
- override protected def getValue () = _value
58
-
59
57
/**
60
58
* Value of the broadcast object. On driver, this is set directly by the constructor.
61
59
* On executors, this is reconstructed by [[readObject ]], which builds this value by reading
@@ -68,6 +66,8 @@ private[spark] class TorrentBroadcast[T: ClassTag](
68
66
69
67
private val broadcastId = BroadcastBlockId (id)
70
68
69
+ override protected def getValue () = _value
70
+
71
71
/**
72
72
* Divide the object into multiple blocks and put those blocks in the block manager.
73
73
*
@@ -79,7 +79,7 @@ private[spark] class TorrentBroadcast[T: ClassTag](
79
79
// TODO: Use putBytes directly.
80
80
SparkEnv .get.blockManager.putSingle(
81
81
BroadcastBlockId (id, " piece" + i),
82
- blocks(i) ,
82
+ block ,
83
83
StorageLevel .MEMORY_AND_DISK_SER ,
84
84
tellMaster = true )
85
85
}
@@ -89,7 +89,7 @@ private[spark] class TorrentBroadcast[T: ClassTag](
89
89
/** Fetch torrent blocks from the driver and/or other executors. */
90
90
private def readBlocks (): Array [Array [Byte ]] = {
91
91
// Fetch chunks of data. Note that all these chunks are stored in the BlockManager and reported
92
- // to the driver, so other executors can pull these thunks from this executor as well.
92
+ // to the driver, so other executors can pull these chunks from this executor as well.
93
93
var numBlocksAvailable = 0
94
94
val blocks = new Array [Array [Byte ]](numBlocks)
95
95
@@ -149,7 +149,7 @@ private[spark] class TorrentBroadcast[T: ClassTag](
149
149
logInfo(" Reading broadcast variable " + id + " took " + time + " s" )
150
150
151
151
_value = TorrentBroadcast .unBlockifyObject[T ](blocks)
152
- // Store the merged copy in BlockManager so other tasks on this executor doesn 't
152
+ // Store the merged copy in BlockManager so other tasks on this executor don 't
153
153
// need to re-fetch it.
154
154
SparkEnv .get.blockManager.putSingle(
155
155
broadcastId, _value, StorageLevel .MEMORY_AND_DISK , tellMaster = false )
0 commit comments