This is an automated email from the ASF dual-hosted git repository. kgyrtkirk 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 c721046 HIVE-23088: Using Strings from log4j breaks non-log4j users (David Lavati via Panagiotis Garefalakis, Zoltan Haindrich) c721046 is described below commit c721046923723a351d81aa2f2097654c168826f3 Author: David Lavati <david.lav...@gmail.com> AuthorDate: Thu Apr 23 15:26:00 2020 +0000 HIVE-23088: Using Strings from log4j breaks non-log4j users (David Lavati via Panagiotis Garefalakis, Zoltan Haindrich) Signed-off-by: Zoltan Haindrich <zhaindr...@cloudera.com> --- .../util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java | 7 +++---- ql/src/java/org/apache/hadoop/hive/ql/hooks/HookUtils.java | 4 ++-- service/src/java/org/apache/hive/service/server/HiveServer2.java | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index bbcada9..0e41ee9 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -113,7 +113,6 @@ import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hive.common.util.StreamPrinter; import org.apache.hive.druid.MiniDruidCluster; import org.apache.hive.kafka.SingleNodeKafkaCluster; -import org.apache.logging.log4j.util.Strings; import org.apache.tools.ant.BuildException; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; @@ -413,7 +412,7 @@ public class QTestUtil { Path userInstallPath; if (isLocalFs) { String buildDir = System.getProperty(BUILD_DIR_PROPERTY); - Preconditions.checkState(Strings.isNotBlank(buildDir)); + Preconditions.checkState(StringUtils.isNotBlank(buildDir)); Path path = new Path(fsUriString, buildDir); // Create a fake fs root for local fs @@ -2081,7 +2080,7 @@ public class QTestUtil { .append(qfiles[i].getName()) .append(" results check failed with error code ") .append(result.getReturnCode()); - if (Strings.isNotEmpty(result.getCapturedOutput())) { + if (StringUtils.isNotEmpty(result.getCapturedOutput())) { builder.append(" and diff value ").append(result.getCapturedOutput()); } System.err.println(builder.toString()); @@ -2139,7 +2138,7 @@ public class QTestUtil { .append(qfiles[i].getName()) .append(" results check failed with error code ") .append(result.getReturnCode()); - if (Strings.isNotEmpty(result.getCapturedOutput())) { + if (StringUtils.isNotEmpty(result.getCapturedOutput())) { builder.append(" and diff value ").append(result.getCapturedOutput()); } System.err.println(builder.toString()); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookUtils.java index 0841d67..58e95e1 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookUtils.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookUtils.java @@ -21,10 +21,10 @@ package org.apache.hadoop.hive.ql.hooks; import java.util.ArrayList; import java.util.List; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.ql.exec.Utilities; -import org.apache.logging.log4j.util.Strings; public class HookUtils { @@ -47,7 +47,7 @@ public class HookUtils { throws InstantiationException, IllegalAccessException, ClassNotFoundException { String csHooks = conf.getVar(hookConfVar); List<T> hooks = new ArrayList<>(); - if (Strings.isBlank(csHooks)) { + if (StringUtils.isBlank(csHooks)) { return hooks; } String[] hookClasses = csHooks.split(","); diff --git a/service/src/java/org/apache/hive/service/server/HiveServer2.java b/service/src/java/org/apache/hive/service/server/HiveServer2.java index e72ab59..9396068 100644 --- a/service/src/java/org/apache/hive/service/server/HiveServer2.java +++ b/service/src/java/org/apache/hive/service/server/HiveServer2.java @@ -111,7 +111,6 @@ import org.apache.http.client.methods.HttpDelete; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import org.apache.logging.log4j.util.Strings; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; @@ -323,7 +322,7 @@ public class HiveServer2 extends CompositeService { if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_WEBUI_USE_SSL)) { String keyStorePath = hiveConf.getVar( ConfVars.HIVE_SERVER2_WEBUI_SSL_KEYSTORE_PATH); - if (Strings.isBlank(keyStorePath)) { + if (StringUtils.isBlank(keyStorePath)) { throw new IllegalArgumentException( ConfVars.HIVE_SERVER2_WEBUI_SSL_KEYSTORE_PATH.varname + " Not configured for SSL connection"); @@ -338,7 +337,7 @@ public class HiveServer2 extends CompositeService { ConfVars.HIVE_SERVER2_WEBUI_SPNEGO_PRINCIPAL); String spnegoKeytab = hiveConf.getVar( ConfVars.HIVE_SERVER2_WEBUI_SPNEGO_KEYTAB); - if (Strings.isBlank(spnegoPrincipal) || Strings.isBlank(spnegoKeytab)) { + if (StringUtils.isBlank(spnegoPrincipal) || StringUtils.isBlank(spnegoKeytab)) { throw new IllegalArgumentException( ConfVars.HIVE_SERVER2_WEBUI_SPNEGO_PRINCIPAL.varname + "/" + ConfVars.HIVE_SERVER2_WEBUI_SPNEGO_KEYTAB.varname @@ -353,7 +352,8 @@ public class HiveServer2 extends CompositeService { String allowedOrigins = hiveConf.getVar(ConfVars.HIVE_SERVER2_WEBUI_CORS_ALLOWED_ORIGINS); String allowedMethods = hiveConf.getVar(ConfVars.HIVE_SERVER2_WEBUI_CORS_ALLOWED_METHODS); String allowedHeaders = hiveConf.getVar(ConfVars.HIVE_SERVER2_WEBUI_CORS_ALLOWED_HEADERS); - if (Strings.isBlank(allowedOrigins) || Strings.isBlank(allowedMethods) || Strings.isBlank(allowedHeaders)) { + if (StringUtils.isBlank(allowedOrigins) || StringUtils.isBlank(allowedMethods) || StringUtils + .isBlank(allowedHeaders)) { throw new IllegalArgumentException("CORS enabled. But " + ConfVars.HIVE_SERVER2_WEBUI_CORS_ALLOWED_ORIGINS.varname + "/" + ConfVars.HIVE_SERVER2_WEBUI_CORS_ALLOWED_METHODS.varname + "/" +