snehashisp commented on code in PR #17741:
URL: https://github.com/apache/kafka/pull/17741#discussion_r1876867588


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java:
##########
@@ -367,6 +371,13 @@ public Object newPlugin(String classOrAlias, VersionRange 
range) throws Versione
         return newPlugin(klass);
     }
 
+    public <T> Object newPlugin(String classOrAlias, Class<T> baseClass, 
VersionRange range) throws ClassNotFoundException {

Review Comment:
   I'm not sure how to solve this in the best way. The problem I see is 
`Utils.newInstance` will try and instantiate with the current classloader, and 
will fetch the local converter instance, if one such is bundled in with the 
connector plugin. On the other hand, providing a null version in `newPlugins` 
will load the latest version of the plugin amongst all the pluginloaders. We 
should maintain the existing behavior which uses `Utils.newInstance`. Is it 
okay to add something like `newPlugin(PluginClassloader, pluginName, version)` 
which will load with the provided class loader, if verison is null or use 
delegating loader to get a versioned plugin. 



-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to