From b389ababfd1a89c2c57e17fe38153ae6c16d84d4 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Wed, 31 Jul 2024 18:04:44 +0800 Subject: [PATCH] HIVE-28417: Bump Log4j2 to 2.24.1 to facilitate compilation of GraalVM Native Image --- data/conf/hive-log4j2.properties | 10 +--------- llap-server/pom.xml | 3 +-- .../hadoop/hive/llap/daemon/impl/QueryTracker.java | 5 +++-- .../hive/llap/daemon/impl/TestLlapDaemonLogging.java | 2 +- pom.xml | 3 +-- standalone-metastore/metastore-server/pom.xml | 8 ++++++-- .../hive/metastore/utils/TestMetaStoreServerUtils.java | 2 +- standalone-metastore/pom.xml | 2 +- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/data/conf/hive-log4j2.properties b/data/conf/hive-log4j2.properties index eac59b319428..5eb2480a2a6e 100644 --- a/data/conf/hive-log4j2.properties +++ b/data/conf/hive-log4j2.properties @@ -14,9 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -status = INFO name = HiveLog4j2Test -packages = org.apache.hadoop.hive.ql.log # list of properties property.hive.log.level = DEBUG @@ -25,9 +23,6 @@ property.hive.log.dir = ${sys:test.tmp.dir}/log property.hive.log.file = hive.log property.hive.test.console.log.level = INFO -# list of all appenders -appenders = console, DRFA - # console appender appender.console.type = Console appender.console.name = console @@ -49,9 +44,6 @@ appender.DRFA.policies.time.modulate = true appender.DRFA.strategy.type = DefaultRolloverStrategy appender.DRFA.strategy.max = 30 -# list of all loggers -loggers = HadoopIPC, HadoopSecurity, Hdfs, HdfsServer, HadoopMetrics2, Mortbay, Yarn, YarnServer, Tez, HadoopConf, Zookeeper, ServerCnxn, NIOServerCnxn, ClientCnxn, ClientCnxnSocket, ClientCnxnSocketNIO, DataNucleus, Datastore, JPOX, Operator, Serde2Lazy, ObjectStore, CalcitePlanner, AmazonAws, ApacheHttp, Thrift, Jetty, BlockStateChange, swo, CBORuleLogger - logger.HadoopIPC.name = org.apache.hadoop.ipc logger.HadoopIPC.level = WARN @@ -128,7 +120,7 @@ logger.CBORuleLogger.filter.marker.type = MarkerFilter logger.CBORuleLogger.filter.marker.marker = FULL_PLAN # Change filter to ACCEPT, to see the produced plan after every rule invocation using the EXPLAIN CBO format logger.CBORuleLogger.filter.marker.onMatch = DENY -logger.CBORuleLogger.filter.marker.onMisMatch = NEUTRAL +logger.CBORuleLogger.filter.marker.onMismatch = NEUTRAL logger.AmazonAws.name=com.amazonaws logger.AmazonAws.level = INFO diff --git a/llap-server/pom.xml b/llap-server/pom.xml index d90296d6023c..0905ca1f24b4 100644 --- a/llap-server/pom.xml +++ b/llap-server/pom.xml @@ -367,9 +367,8 @@ org.apache.logging.log4j - log4j-core + log4j-core-test ${log4j2.version} - tests test diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryTracker.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryTracker.java index 6cfa076b9db4..39eda657d5a8 100644 --- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryTracker.java +++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryTracker.java @@ -48,8 +48,9 @@ import org.apache.tez.common.security.TokenCache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.Marker; import org.slf4j.MDC; +import org.slf4j.Marker; +import org.slf4j.impl.StaticMarkerBinder; import java.io.IOException; import java.util.Collections; @@ -70,7 +71,7 @@ public class QueryTracker extends AbstractService { private static final Logger LOG = LoggerFactory.getLogger(QueryTracker.class); private static final Marker QUERY_COMPLETE_MARKER = - new Log4jMarker(new Log4jQueryCompleteMarker()); + new Log4jMarker(StaticMarkerBinder.getSingleton().getMarkerFactory(), new Log4jQueryCompleteMarker()); /// Shared singleton MetricsSource instance for all DAG locks private static final MetricsSource LOCK_METRICS; diff --git a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapDaemonLogging.java b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapDaemonLogging.java index 9b03f0fb162e..0145da1a51cc 100644 --- a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapDaemonLogging.java +++ b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapDaemonLogging.java @@ -25,7 +25,7 @@ import org.apache.hadoop.security.token.Token; import org.apache.hive.testutils.junit.extensions.DoNothingTCPServer; import org.apache.hive.testutils.junit.extensions.DoNothingTCPServerExtension; -import org.apache.logging.log4j.junit.LoggerContextSource; +import org.apache.logging.log4j.core.test.junit.LoggerContextSource; import org.apache.tez.common.security.TokenCache; import org.junit.jupiter.api.Test; diff --git a/pom.xml b/pom.xml index f93a928908be..9f4b129fb29d 100644 --- a/pom.xml +++ b/pom.xml @@ -175,7 +175,7 @@ 0.9.3 0.16.0 - 2.18.0 + 2.24.1 2.5.0 6.2.1.jre8 8.0.31 @@ -1791,7 +1791,6 @@ ${test.log4j.scheme}${test.conf.dir}/hive-log4j2.properties ${test.console.log.level} hive-test-cluster-id-cli - true ${test.tmp.dir} diff --git a/standalone-metastore/metastore-server/pom.xml b/standalone-metastore/metastore-server/pom.xml index 883c55a48392..83f0c50894b0 100644 --- a/standalone-metastore/metastore-server/pom.xml +++ b/standalone-metastore/metastore-server/pom.xml @@ -418,9 +418,13 @@ org.apache.logging.log4j - log4j-core + log4j-core-test ${log4j2.version} - tests + test + + + org.junit.vintage + junit-vintage-engine test diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/utils/TestMetaStoreServerUtils.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/utils/TestMetaStoreServerUtils.java index b78e571b9383..071d7111c1b0 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/utils/TestMetaStoreServerUtils.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/utils/TestMetaStoreServerUtils.java @@ -44,7 +44,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.config.LoggerConfig; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; import org.apache.thrift.TException; import org.hamcrest.core.IsNot; import org.junit.After; diff --git a/standalone-metastore/pom.xml b/standalone-metastore/pom.xml index 6d4eba249986..bbea269c38b6 100644 --- a/standalone-metastore/pom.xml +++ b/standalone-metastore/pom.xml @@ -89,7 +89,7 @@ 5.6.3 0.9.3 0.16.0 - 2.18.0 + 2.24.1 3.4.4 1.9.4 3.24.4