mridulm commented on a change in pull request #33957:
URL: https://github.com/apache/spark/pull/33957#discussion_r716311556



##########
File path: core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala
##########
@@ -90,8 +94,6 @@ private[spark] class TorrentBroadcast[T: ClassTag](obj: T, 
id: Long)
   /** Total number of blocks this broadcast variable contains. */
   private val numBlocks: Int = writeBlocks(obj)
 
-  /** Whether to generate checksum for blocks or not. */
-  private var checksumEnabled: Boolean = false
   /** The checksum for all the blocks. */
   private var checksums: Array[Int] = _

Review comment:
       TL/DR; you are right, no change required for `checksums`.
   
   The difference seems to be a nuance of `_` vs explicit value (`checksums` is 
initialized in `val nunBlocks = writeBlocks(obj)`, while declared after).
   
   ```
   scala > class Test { 
        |   var a = test()
        |   var b: String = "123"
        |   var c: String = _
        |   def test(): Int = {
        |     b = "abc"
        |     c = "abc"
        |     1
        |   }
        | }
        
   scala> val test = new Test()
   val test: Test = Test@2184c27b
   
   scala> test.a
   val res11: Int = 1
   
   scala> test.b
   val res12: String = 123
   
   scala> test.c
   val res13: String = abc
   ```
   
   
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to