hubgeter commented on code in PR #42507:
URL: https://github.com/apache/doris/pull/42507#discussion_r1817989956


##########
be/src/util/jvm_metrics.cpp:
##########
@@ -182,193 +188,260 @@ void JvmMetrics::update() {
     }
 }
 
-void JvmStats::init(JNIEnv* ENV) {
-    env = ENV;
-    _managementFactoryClass = 
env->FindClass("java/lang/management/ManagementFactory");
-    if (_managementFactoryClass == nullptr) {
-        LOG(WARNING)
-                << "Class java/lang/management/ManagementFactory Not Find.JVM 
monitoring fails.";
-        return;
-    }
+Status JvmStats::init() {
+    JNIEnv* env = nullptr;
+    RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));

Review Comment:
   There is really no need



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