You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/20 21:50:04 UTC

[GitHub] [pulsar] jerrypeng commented on a change in pull request #6983: Added ability to add annotations to Connector Configs

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:
users@infra.apache.org