srkukarni commented on a change in pull request #6983:
URL: https://github.com/apache/pulsar/pull/6983#discussion_r428338513
##########
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:
Changed
##########
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();
+ Object configObject = mapper.readValue(new
ObjectMapper().writeValueAsString(sinkConfig.getConfigs()), configClass);
Review comment:
Changed
----------------------------------------------------------------
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]