You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by zh...@apache.org on 2020/04/20 00:31:07 UTC

[incubator-doris] branch master updated: Add LOG.isDebugEnabled for some debug logical of Coordinator (#3352)

This is an automated email from the ASF dual-hosted git repository.

zhaoc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 753d6cc  Add LOG.isDebugEnabled for some debug logical of Coordinator (#3352)
753d6cc is described below

commit 753d6cc19f47f78db45ff69ba0fc2f7e7d3d289d
Author: Yunfeng,Wu <wu...@baidu.com>
AuthorDate: Mon Apr 20 08:30:57 2020 +0800

    Add LOG.isDebugEnabled for some debug logical of Coordinator (#3352)
    
    This may very slightly affect the performance or not.
---
 .../main/java/org/apache/doris/qe/Coordinator.java | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/fe/src/main/java/org/apache/doris/qe/Coordinator.java b/fe/src/main/java/org/apache/doris/qe/Coordinator.java
index 20c4477..c409e97 100644
--- a/fe/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -377,12 +377,12 @@ public class Coordinator {
     // be for a query like 'SELECT 1').
     // A call to Exec() must precede all other member function calls.
     public void exec() throws Exception {
-        if (!scanNodes.isEmpty()) {
+        if (LOG.isDebugEnabled() && !scanNodes.isEmpty()) {
             LOG.debug("debug: in Coordinator::exec. query id: {}, planNode: {}",
                     DebugUtil.printId(queryId), scanNodes.get(0).treeToThrift());
         }
 
-        if (!fragments.isEmpty()) {
+        if (LOG.isDebugEnabled() && !fragments.isEmpty()) {
             LOG.debug("debug: in Coordinator::exec. query id: {}, fragment: {}",
                     DebugUtil.printId(queryId), fragments.get(0).toThrift());
         }
@@ -461,8 +461,10 @@ public class Coordinator {
                     backendExecStates.add(execState);
                     if (needCheckBackendState) {
                         needCheckBackendExecStates.add(execState);
-                        LOG.debug("add need check backend {} for fragment, {} job: {}", execState.backend.getId(),
-                                fragment.getFragmentId().asInt(), jobId);
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("add need check backend {} for fragment, {} job: {}", execState.backend.getId(),
+                                    fragment.getFragmentId().asInt(), jobId);
+                        }
                     }
                     futures.add(Pair.create(execState, execState.execRemoteFragmentAsync()));
 
@@ -722,7 +724,9 @@ public class Coordinator {
         // assign instance ids
         instanceIds.clear();
         for (FragmentExecParams params : fragmentExecParamsMap.values()) {
-            LOG.debug("fragment {} has instances {}", params.fragment.getFragmentId(), params.instanceExecParams.size());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("fragment {} has instances {}", params.fragment.getFragmentId(), params.instanceExecParams.size());
+            }
             for (int j = 0; j < params.instanceExecParams.size(); ++j) {
                 // we add instance_num to query_id.lo to create a
                 // globally-unique instance id
@@ -1373,9 +1377,11 @@ public class Coordinator {
         // cancel the fragment instance.
         // return true if cancel success. Otherwise, return false
         public synchronized boolean cancelFragmentInstance(PPlanFragmentCancelReason cancelReason) {
-            LOG.debug("cancelRemoteFragments initiated={} done={} hasCanceled={} backend: {}, fragment instance id={}, reason: {}",
-                    this.initiated, this.done, this.hasCanceled, backend.getId(),
-                    DebugUtil.printId(fragmentInstanceId()), cancelReason.name());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("cancelRemoteFragments initiated={} done={} hasCanceled={} backend: {}, fragment instance id={}, reason: {}",
+                        this.initiated, this.done, this.hasCanceled, backend.getId(),
+                        DebugUtil.printId(fragmentInstanceId()), cancelReason.name());
+            }
             try {
                 if (!this.initiated) {
                     return false;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org