dongjoon-hyun commented on code in PR #46873:
URL: https://github.com/apache/spark/pull/46873#discussion_r1678871813
##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -3072,15 +3072,14 @@ private[spark] object Utils
*/
lazy val isG1GC: Boolean = {
Try {
+ // SPARK-48505: If the initialization probe of `HotSpotDiagnosticMXBean`
is successful,
+ // the API of `HotSpotDiagnosticMXBean` can be used directly in
subsequent operations,
+ // instead of invoking it through reflection.
val clazz =
Utils.classForName("com.sun.management.HotSpotDiagnosticMXBean")
- .asInstanceOf[Class[_ <: PlatformManagedObject]]
- val vmOptionClazz = Utils.classForName("com.sun.management.VMOption")
+ import com.sun.management.HotSpotDiagnosticMXBean
Review Comment:
Although the code becomes simpler, I'm not sure this is a better recommended
style: `import com.sun.*` in our source code.
There is a similar discussion here.
- https://github.com/apache/spark/pull/43503#discussion_r1671300283
--
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]