C0urante commented on code in PR #13821:
URL: https://github.com/apache/kafka/pull/13821#discussion_r1246708497


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java:
##########
@@ -147,229 +151,7 @@ PluginClassLoader newPluginClassLoader(
         );
     }
 
-    public PluginScanResult initLoaders() {
-        List<PluginScanResult> results = new ArrayList<>();
-        for (Path pluginLocation : pluginLocations) {
-            try {
-                results.add(registerPlugin(pluginLocation));
-            } catch (InvalidPathException | MalformedURLException e) {
-                log.error("Invalid path in plugin path: {}. Ignoring.", 
pluginLocation, e);
-            } catch (IOException e) {
-                log.error("Could not get listing for plugin path: {}. 
Ignoring.", pluginLocation, e);
-            }
-        }
-        // Finally add parent/system loader.
-        results.add(scanUrlsAndAddPlugins(
-                getParent(),
-                ClasspathHelper.forJavaClassPath().toArray(new URL[0])
-        ));
-        PluginScanResult scanResult = new PluginScanResult(results);
-        installDiscoveredPlugins(scanResult);
-        return scanResult;
-    }
-
-    private PluginScanResult registerPlugin(Path pluginLocation)
-        throws IOException {
-        log.info("Loading plugin from: {}", pluginLocation);
-        List<URL> pluginUrls = new ArrayList<>();
-        for (Path path : PluginUtils.pluginUrls(pluginLocation)) {
-            pluginUrls.add(path.toUri().toURL());
-        }
-        URL[] urls = pluginUrls.toArray(new URL[0]);
-        if (log.isDebugEnabled()) {
-            log.debug("Loading plugin urls: {}", Arrays.toString(urls));
-        }
-        PluginClassLoader loader = newPluginClassLoader(
-                pluginLocation.toUri().toURL(),
-                urls,
-                this
-        );
-        return scanUrlsAndAddPlugins(loader, urls);
-    }
-
-    private PluginScanResult scanUrlsAndAddPlugins(
-            ClassLoader loader,
-            URL[] urls
-    ) {
-        PluginScanResult plugins = scanPluginPath(loader, urls);
-        log.info("Registered loader: {}", loader);

Review Comment:
   💯 Thanks!



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