jerrypeng commented on a change in pull request #6983:
URL: https://github.com/apache/pulsar/pull/6983#discussion_r428327699



##########
File path: 
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java
##########
@@ -580,4 +595,24 @@ public static SinkConfig validateUpdate(SinkConfig 
existingConfig, SinkConfig ne
         }
         return mergedConfig;
     }
+
+    public static void validateConnectorConfig(SinkConfig sinkConfig, 
ClassLoader classLoader) {
+        try {
+            ConnectorDefinition defn = 
ConnectorUtils.getConnectorDefinition(classLoader);
+            if (defn.getSinkConfigClass() != null) {
+                Class configClass = Class.forName(defn.getSinkConfigClass(),  
true, classLoader);
+                ObjectMapper mapper = new ObjectMapper();

Review comment:
       Please use ObjectMapperFactor.getThreadLocal

##########
File path: 
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java
##########
@@ -580,4 +595,24 @@ public static SinkConfig validateUpdate(SinkConfig 
existingConfig, SinkConfig ne
         }
         return mergedConfig;
     }
+
+    public static void validateConnectorConfig(SinkConfig sinkConfig, 
ClassLoader classLoader) {
+        try {
+            ConnectorDefinition defn = 
ConnectorUtils.getConnectorDefinition(classLoader);
+            if (defn.getSinkConfigClass() != null) {
+                Class configClass = Class.forName(defn.getSinkConfigClass(),  
true, classLoader);
+                ObjectMapper mapper = new ObjectMapper();

Review comment:
       Please use ObjectMapperFactory.getThreadLocal




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to