Hisoka-X commented on code in PR #8603:
URL: https://github.com/apache/seatunnel/pull/8603#discussion_r1951943295
##########
seatunnel-plugin-discovery/src/main/java/org/apache/seatunnel/plugin/discovery/AbstractPluginDiscovery.java:
##########
@@ -114,6 +114,9 @@ public AbstractPluginDiscovery(
this.pluginDir = pluginDir;
this.pluginMappingConfig = pluginMappingConfig;
this.addURLToClassLoaderConsumer = addURLToClassLoaderConsumer;
+ this.sourcePluginInstance = getAllSupportedPlugins(PluginType.SOURCE);
+ this.sinkPluginInstance = getAllSupportedPlugins(PluginType.SINK);
+ this.transformPluginInstance =
getAllSupportedPlugins(PluginType.TRANSFORM);
Review Comment:
why we should cache this? It just store the connector jar prefix mapping. We
can get the connector prefix when we used it.
##########
seatunnel-plugin-discovery/src/main/java/org/apache/seatunnel/plugin/discovery/AbstractPluginDiscovery.java:
##########
@@ -439,10 +438,10 @@ public boolean accept(File pathname) {
if (targetPluginFiles.length == 1) {
pluginJarPath = targetPluginFiles[0].toURI().toURL();
} else {
+ PluginType type = PluginType.valueOf(pluginType.toUpperCase());
+ String targetPlugin = getTargetPluginName(pluginIdentifier,
type);
pluginJarPath =
- findMostSimlarPluginJarFile(targetPluginFiles,
pluginJarPrefix)
- .toURI()
- .toURL();
+ selectPluginJar(targetPluginFiles, targetPlugin,
pluginName, type).get();
Review Comment:
The `pluginJarPrefix` equals `targetPlugin`. So we can just use
`pluginJarPrefix`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]