You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2023/03/22 03:10:36 UTC

[impala] 01/03: IMPALA-12003: Make getPartialCatalogObject logging silent

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

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit e8a879c30db31d64108b0b6d97739558fcaf62f0
Author: prozsa <pr...@cloudera.com>
AuthorDate: Thu Mar 16 11:41:57 2023 +0100

    IMPALA-12003: Make getPartialCatalogObject logging silent
    
    This patch changes the getPartialCatalogObject catalog operation
    to use the silent execution path. The silent execution path is now
    logging in trace level instead of suppressing the logging at all, making
    it possible to track start-stop events for silent operations.
    
    Change-Id: I45e331eb299c057c2fdc6a3c2ed7e4ed6d1f40b7
    Reviewed-on: http://gerrit.cloudera.org:8080/19627
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 fe/src/main/java/org/apache/impala/common/JniUtil.java | 18 ++++++++++++------
 .../java/org/apache/impala/service/JniCatalog.java     |  2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/common/JniUtil.java b/fe/src/main/java/org/apache/impala/common/JniUtil.java
index d447156c3..6002e88c6 100644
--- a/fe/src/main/java/org/apache/impala/common/JniUtil.java
+++ b/fe/src/main/java/org/apache/impala/common/JniUtil.java
@@ -159,16 +159,22 @@ public class JniUtil {
     }
 
     public void logStart() {
-      if (!silentStartAndFinish) {
-        LOG.info("{} request: {}", methodName, shortDescription);
+      final String startFormat = "{} request: {}";
+      if (silentStartAndFinish) {
+        LOG.trace(startFormat, methodName, shortDescription);
+      } else {
+        LOG.info(startFormat, methodName, shortDescription);
       }
     }
 
     public void logFinish() {
-      if (!silentStartAndFinish) {
-        long duration = getDurationFromStart();
-        LOG.info("Finished {} request: {}. Time spent: {}", methodName, shortDescription,
-            PrintUtils.printTimeMs(duration));
+      final String finishFormat = "Finished {} request: {}. Time spent: {}";
+      long duration = getDurationFromStart();
+      String durationString = PrintUtils.printTimeMs(duration);
+      if (silentStartAndFinish) {
+        LOG.trace(finishFormat, methodName, shortDescription, durationString);
+      } else {
+        LOG.info(finishFormat, methodName, shortDescription, durationString);
       }
     }
 
diff --git a/fe/src/main/java/org/apache/impala/service/JniCatalog.java b/fe/src/main/java/org/apache/impala/service/JniCatalog.java
index 8d3488e5c..d5afb46ab 100644
--- a/fe/src/main/java/org/apache/impala/service/JniCatalog.java
+++ b/fe/src/main/java/org/apache/impala/service/JniCatalog.java
@@ -393,7 +393,7 @@ public class JniCatalog {
     String shortDesc = "Getting partial catalog object of "
         + Catalog.toCatalogObjectKey(req.getObject_desc());
 
-    return execAndSerialize("getPartialCatalogObject", shortDesc,
+    return execAndSerializeSilentStartAndFinish("getPartialCatalogObject", shortDesc,
         () -> catalog_.getPartialCatalogObject(req));
   }