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

sankarh pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/branch-3 by this push:
     new d4adc0734bc HIVE-27609: Backport HIVE-22115: Prevent the creation of 
query routing appender if property is set to false (Slim Bouguerra reviewed by 
Gopal V)
d4adc0734bc is described below

commit d4adc0734bc336ad38d8aa689522b9b0e0ff4535
Author: Aman Raj <[email protected]>
AuthorDate: Sun Aug 20 20:44:11 2023 +0530

    HIVE-27609: Backport HIVE-22115: Prevent the creation of query routing 
appender if property is set to false (Slim Bouguerra reviewed by Gopal V)
    
    Signed-off-by: Sankar Hariappan <[email protected]>
    Closes (#4588)
---
 ql/src/java/org/apache/hadoop/hive/ql/log/LogDivertAppender.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/log/LogDivertAppender.java 
b/ql/src/java/org/apache/hadoop/hive/ql/log/LogDivertAppender.java
index 0105fd51c66..dd25f622c73 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/log/LogDivertAppender.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/log/LogDivertAppender.java
@@ -172,6 +172,10 @@ public class LogDivertAppender {
    * @param conf  the configuration for HiveServer2 instance
    */
   public static void 
registerRoutingAppender(org.apache.hadoop.conf.Configuration conf) {
+    if (!HiveConf.getBoolVar(conf, 
HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED, false)) {
+      // spare some resources, do not register logger if it is not enabled .
+      return;
+    }
     String loggingLevel = HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL);
     OperationLog.LoggingLevel loggingMode = 
OperationLog.getLoggingLevel(loggingLevel);
     String layout = loggingMode == OperationLog.LoggingLevel.VERBOSE ? 
verboseLayout : nonVerboseLayout;

Reply via email to