jackierwzhang commented on PR #50746:
URL: https://github.com/apache/spark/pull/50746#issuecomment-2837152130

   > The code looks OK - meta question: I see you changed val to lazy val in 
multiple places. Is that intentional, and if it is, mind explaining?
   
   Yes, there are mainly two reason:
   1. I don't want the initialization of the class to automatically initialize 
the logs since they involve FS operations, only direct access should initialize 
the logs.
   2. Overriding a lazy val in StreamExecution is easier to reason that a plain 
val, which may be null when it's overridden by the subclass and hence throw 
NPE. For example, 
[this](https://github.com/apache/spark/pull/50746/files#diff-7e8a99d76adb60a2d85609ab46bb2867cd83de106b3c048d6d955805824c9bb6L175)
 `id` may throw null because `checkpointMetadata` above it is overridden.


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to