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

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


The following commit(s) were added to refs/heads/master by this push:
     new bfbb724  minor, fix a sonar reported bug
bfbb724 is described below

commit bfbb72451219631b2c155c9f6b14e41ced1c4778
Author: shaofengshi <shaofeng...@apache.org>
AuthorDate: Wed Aug 19 08:31:20 2020 +0800

    minor, fix a sonar reported bug
---
 .../apache/kylin/common/kafka/KafkaMsgProducer.java   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git 
a/core-common/src/main/java/org/apache/kylin/common/kafka/KafkaMsgProducer.java 
b/core-common/src/main/java/org/apache/kylin/common/kafka/KafkaMsgProducer.java
index 98068a8..f653e3f 100644
--- 
a/core-common/src/main/java/org/apache/kylin/common/kafka/KafkaMsgProducer.java
+++ 
b/core-common/src/main/java/org/apache/kylin/common/kafka/KafkaMsgProducer.java
@@ -36,17 +36,16 @@ public class KafkaMsgProducer {
     private static Map<String, String> kafkaConfig;
     private static String TOPIC_NAME;
 
+    private static final Properties kafkaProperties = new Properties();
 
-    private static Properties kafkaProperties = new Properties() {
-        {
-            put(ProducerConfig.ACKS_CONFIG, "-1");
-            put(ProducerConfig.RETRIES_CONFIG, 3);
-            put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4");
-            put(ProducerConfig.LINGER_MS_CONFIG, 500);
-            put(ProducerConfig.BATCH_SIZE_CONFIG, 10000);
-            put("max.in.flight.requests.per.connection", 1);
-        }
-    };
+    static {
+        kafkaProperties.put(ProducerConfig.ACKS_CONFIG, "-1");
+        kafkaProperties.put(ProducerConfig.RETRIES_CONFIG, 3);
+        kafkaProperties.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4");
+        kafkaProperties.put(ProducerConfig.LINGER_MS_CONFIG, 500);
+        kafkaProperties.put(ProducerConfig.BATCH_SIZE_CONFIG, 10000);
+        kafkaProperties.put("max.in.flight.requests.per.connection", 1);
+    }
 
 
     private KafkaMsgProducer() {

Reply via email to