You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/06/08 11:25:22 UTC

[incubator-inlong] 02/02: [INLONG-4591][Sort] Set the default Hive version and upgrade the log4j to log4j2 (#4592)

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

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

commit be7d72cf2e84d0b337323f57b7820a0f9660f754
Author: ganfengtan <Ga...@users.noreply.github.com>
AuthorDate: Wed Jun 8 18:00:27 2022 +0800

    [INLONG-4591][Sort] Set the default Hive version and upgrade the log4j to log4j2 (#4592)
---
 .../sort/protocol/node/load/HiveLoadNode.java       |  3 ++-
 .../{log4j.properties => log4j2.properties}         | 21 +++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java b/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java
index c0b8c9208..670761e12 100644
--- a/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java
+++ b/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java
@@ -52,6 +52,7 @@ public class HiveLoadNode extends LoadNode implements Serializable {
     private static final String timestampPattern = "partition.time-extractor.timestamp-pattern";
     private static final String delay = "sink.partition-commit.delay";
     private static final String policyKind = "sink.partition-commit.policy.kind";
+    private static final String HIVE_VERSION = "3.1.2";
 
     @JsonProperty("tableName")
     @Nonnull
@@ -99,7 +100,7 @@ public class HiveLoadNode extends LoadNode implements Serializable {
         this.database = Preconditions.checkNotNull(database, "database of hive is null");
         this.tableName = Preconditions.checkNotNull(tableName, "table of hive is null");
         this.hiveConfDir = hiveConfDir;
-        this.hiveVersion = hiveVersion;
+        this.hiveVersion = null == hiveVersion ? HIVE_VERSION : hiveVersion;
         this.catalogName = catalogName;
         this.hadoopConfDir = hadoopConfDir;
         this.partitionFields = partitionFields;
diff --git a/inlong-sort/sort-core/src/main/resources/log4j.properties b/inlong-sort/sort-core/src/main/resources/log4j2.properties
similarity index 65%
rename from inlong-sort/sort-core/src/main/resources/log4j.properties
rename to inlong-sort/sort-core/src/main/resources/log4j2.properties
index 43771fe98..b3148de91 100644
--- a/inlong-sort/sort-core/src/main/resources/log4j.properties
+++ b/inlong-sort/sort-core/src/main/resources/log4j2.properties
@@ -16,13 +16,18 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-log4j.rootLogger=INFO, logger
-# logger is set to be a ConsoleAppender.
-log4j.appender.logger=org.apache.log4j.ConsoleAppender
-log4j.appender.logger.target=System.err
-log4j.appender.logger.layout=org.apache.log4j.PatternLayout
-log4j.appender.logger.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+rootLogger=INFO, logger
+
+appender.out.type=Console
+appender.out.name=logger
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=%-4r [%t] %-5p %c %x - %m%n
+
 # Suppress the irrelevant (wrong) warnings from the Netty channel handler
-log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR, logger
+logger.flinknetty=ERROR, logger
+logger.flinknetty.name=org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
+logger.flinknetty.additivity=false
 # Resource leak detector only works with logging enabled at error level
-log4j.logger.org.apache.flink.shaded.netty4.io.netty.util.ResourceLeakDetector=ERROR, logger
+logger.leakdetector=ERROR, logger
+logger.leakdetector.name=org.apache.flink.shaded.netty4.io.netty.util.ResourceLeakDetector
+logger.leakdetector.additivity=false