Revert "[enhancement](jni)append exception check for jni code."#43497
Revert "[enhancement](jni)append exception check for jni code."#43497hubgeter wants to merge 2 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
| GetMethodID(_threadInfoClass, "getThreadState", "()Ljava/lang/Thread$State;")); | ||
|
|
||
| RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/Thread$State", &_threadStateClass)); | ||
| void JvmStats::init(JNIEnv* ENV) { |
There was a problem hiding this comment.
warning: function 'init' exceeds recommended size/complexity thresholds [readability-function-size]
void JvmStats::init(JNIEnv* ENV) {
^Additional context
be/src/util/jvm_metrics.cpp:184: 125 lines including whitespace and comments (threshold 80)
void JvmStats::init(JNIEnv* ENV) {
^| return; | ||
| } |
There was a problem hiding this comment.
warning: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow]
| return; | |
| } | |
| } |
| } | ||
|
|
||
| Status JvmStats::refresh(JvmMetrics* jvm_metrics) const { | ||
| void JvmStats::refresh(JvmMetrics* jvm_metrics) { |
There was a problem hiding this comment.
warning: function 'refresh' has cognitive complexity of 66 (threshold 50) [readability-function-cognitive-complexity]
void JvmStats::refresh(JvmMetrics* jvm_metrics) {
^Additional context
be/src/util/jvm_metrics.cpp:312: +1, including nesting penalty of 0, nesting level increased to 1
if (!_init_complete) {
^be/src/util/jvm_metrics.cpp:317: +1, including nesting penalty of 0, nesting level increased to 1
if (!st.ok()) {
^be/src/util/jvm_metrics.cpp:332: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_heap_size_bytes_used->set_value(heapMemoryUsed < 0 ? 0 : heapMemoryUsed);
^be/src/util/jvm_metrics.cpp:334: +1, including nesting penalty of 0, nesting level increased to 1
heapMemoryCommitted < 0 ? 0 : heapMemoryCommitted);
^be/src/util/jvm_metrics.cpp:335: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_heap_size_bytes_max->set_value(heapMemoryMax < 0 ? 0 : heapMemoryMax);
^be/src/util/jvm_metrics.cpp:345: +1, including nesting penalty of 0, nesting level increased to 1
nonHeapMemoryCommitted < 0 ? 0 : nonHeapMemoryCommitted);
^be/src/util/jvm_metrics.cpp:346: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_non_heap_size_bytes_used->set_value(nonHeapMemoryUsed < 0 ? 0
^be/src/util/jvm_metrics.cpp:354: +1, including nesting penalty of 0, nesting level increased to 1
for (int i = 0; i < size; ++i) {
^be/src/util/jvm_metrics.cpp:371: +2, including nesting penalty of 1, nesting level increased to 2
if (nameStr != nullptr) {
^be/src/util/jvm_metrics.cpp:373: +3, including nesting penalty of 2, nesting level increased to 3
if (it == _memoryPoolName.end()) {
^be/src/util/jvm_metrics.cpp:376: +3, including nesting penalty of 2, nesting level increased to 3
if (it->second == memoryPoolNameEnum::YOUNG) {
^be/src/util/jvm_metrics.cpp:377: +4, including nesting penalty of 3, nesting level increased to 4
jvm_metrics->jvm_young_size_bytes_used->set_value(used < 0 ? 0 : used);
^be/src/util/jvm_metrics.cpp:378: +4, including nesting penalty of 3, nesting level increased to 4
jvm_metrics->jvm_young_size_bytes_peak_used->set_value(peakUsed < 0 ? 0 : peakUsed);
^be/src/util/jvm_metrics.cpp:379: +4, including nesting penalty of 3, nesting level increased to 4
jvm_metrics->jvm_young_size_bytes_max->set_value(max < 0 ? 0 : max);
^be/src/util/jvm_metrics.cpp:381: +1, nesting level increased to 3
} else if (it->second == memoryPoolNameEnum::OLD) {
^be/src/util/jvm_metrics.cpp:382: +4, including nesting penalty of 3, nesting level increased to 4
jvm_metrics->jvm_old_size_bytes_used->set_value(used < 0 ? 0 : used);
^be/src/util/jvm_metrics.cpp:383: +4, including nesting penalty of 3, nesting level increased to 4
jvm_metrics->jvm_old_size_bytes_peak_used->set_value(peakUsed < 0 ? 0 : peakUsed);
^be/src/util/jvm_metrics.cpp:384: +4, including nesting penalty of 3, nesting level increased to 4
jvm_metrics->jvm_old_size_bytes_max->set_value(max < 0 ? 0 : max);
^be/src/util/jvm_metrics.cpp:407: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_peak_count->set_value(peakThreadCount < 0 ? 0 : peakThreadCount);
^be/src/util/jvm_metrics.cpp:408: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_count->set_value(threadCount < 0 ? 0 : threadCount);
^be/src/util/jvm_metrics.cpp:410: +1, including nesting penalty of 0, nesting level increased to 1
for (int i = 0; i < threadCount; i++) {
^be/src/util/jvm_metrics.cpp:412: +2, including nesting penalty of 1, nesting level increased to 2
if (threadInfo == nullptr) {
^be/src/util/jvm_metrics.cpp:417: +2, including nesting penalty of 1, nesting level increased to 2
if (env->IsSameObject(threadState, _newThreadStateObj)) {
^be/src/util/jvm_metrics.cpp:419: +1, nesting level increased to 2
} else if (env->IsSameObject(threadState, _runnableThreadStateObj)) {
^be/src/util/jvm_metrics.cpp:421: +1, nesting level increased to 2
} else if (env->IsSameObject(threadState, _blockedThreadStateObj)) {
^be/src/util/jvm_metrics.cpp:423: +1, nesting level increased to 2
} else if (env->IsSameObject(threadState, _waitingThreadStateObj)) {
^be/src/util/jvm_metrics.cpp:425: +1, nesting level increased to 2
} else if (env->IsSameObject(threadState, _timedWaitingThreadStateObj)) {
^be/src/util/jvm_metrics.cpp:427: +1, nesting level increased to 2
} else if (env->IsSameObject(threadState, _terminatedThreadStateObj)) {
^be/src/util/jvm_metrics.cpp:434: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_new_count->set_value(threadsNew < 0 ? 0 : threadsNew);
^be/src/util/jvm_metrics.cpp:435: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_runnable_count->set_value(threadsRunnable < 0 ? 0 : threadsRunnable);
^be/src/util/jvm_metrics.cpp:436: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_blocked_count->set_value(threadsBlocked < 0 ? 0 : threadsBlocked);
^be/src/util/jvm_metrics.cpp:437: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_waiting_count->set_value(threadsWaiting < 0 ? 0 : threadsWaiting);
^be/src/util/jvm_metrics.cpp:439: +1, including nesting penalty of 0, nesting level increased to 1
threadsTimedWaiting < 0 ? 0 : threadsTimedWaiting);
^be/src/util/jvm_metrics.cpp:440: +1, including nesting penalty of 0, nesting level increased to 1
jvm_metrics->jvm_thread_terminated_count->set_value(threadsTerminated < 0 ? 0
^be/src/util/jvm_metrics.cpp:448: +1, including nesting penalty of 0, nesting level increased to 1
for (int i = 0; i < numCollectors; i++) {
^be/src/util/jvm_metrics.cpp:455: +2, including nesting penalty of 1, nesting level increased to 2
if (gcNameStr != nullptr) {
^be/src/util/jvm_metrics.cpp:456: +3, including nesting penalty of 2, nesting level increased to 3
if (strcmp(gcNameStr, "G1 Young Generation") == 0) {
^be/src/util/jvm_metrics.cpp:460: +1, nesting level increased to 3
} else {
^| } | ||
|
|
||
| Status JvmStats::refresh(JvmMetrics* jvm_metrics) const { | ||
| void JvmStats::refresh(JvmMetrics* jvm_metrics) { |
There was a problem hiding this comment.
warning: function 'refresh' exceeds recommended size/complexity thresholds [readability-function-size]
void JvmStats::refresh(JvmMetrics* jvm_metrics) {
^Additional context
be/src/util/jvm_metrics.cpp:311: 164 lines including whitespace and comments (threshold 80)
void JvmStats::refresh(JvmMetrics* jvm_metrics) {
^| } | ||
|
|
||
| Status JvmStats::refresh(JvmMetrics* jvm_metrics) const { | ||
| void JvmStats::refresh(JvmMetrics* jvm_metrics) { |
There was a problem hiding this comment.
warning: method 'refresh' can be made const [readability-make-member-function-const]
be/src/util/jvm_metrics.h:102:
- void refresh(JvmMetrics* jvm_metrics);
+ void refresh(JvmMetrics* jvm_metrics) const;| void JvmStats::refresh(JvmMetrics* jvm_metrics) { | |
| void JvmStats::refresh(JvmMetrics* jvm_metrics) const { |
|
TeamCity be ut coverage result: |
|
run buildall |
Reverts #42507