ruanwenjun commented on PR #1923:
URL:
https://github.com/apache/incubator-seatunnel/pull/1923#issuecomment-1131620741
> > @legendtkl I see the code at `Executor`, can the CustomClassLoader load
the plugin jar? it seems you don't add the jar path into the classloader before
you execute below code.
> > ```java
> > Iterator<Factory> factories = ServiceLoader.load(Factory.class,
CLASSLOADER).iterator();
> > ```
>
> Hi, @ruanwenjun , Flink SQL connector jars will not be added to the JVM
classpath by default. We will add it to the classpath when we parse the SQL and
find the connector Factory not in Classloader.
>
> This is what `Executor.loadConnector` method does.
I understand. When the connector has not been loaded, you will find the
connector jar and add to classoader. There is no problem.
```java
while (factories.hasNext()) {
Factory factory = factories.next();
/**
* Handle for two cases:
* 1. Flink built-in connectors.
* 2. Connectors have been placed in classpath.
*/
if (factory.factoryIdentifier().equals(connectorType)) {
return;
}
}
```
--
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]