You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2022/01/25 13:43:00 UTC
[jira] [Closed] (FLINK-25804) Loading and running connector code use separated ClassLoader.
[ https://issues.apache.org/jira/browse/FLINK-25804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martijn Visser closed FLINK-25804.
----------------------------------
Resolution: Duplicate
> Loading and running connector code use separated ClassLoader.
> -------------------------------------------------------------
>
> Key: FLINK-25804
> URL: https://issues.apache.org/jira/browse/FLINK-25804
> Project: Flink
> Issue Type: Bug
> Components: API / Core, Connectors / Common, Table SQL / Runtime
> Affects Versions: 1.14.3
> Reporter: Ada Wong
> Priority: Blocker
>
> When we use multiple connectors could have class conflicts. This class conflict can not be solved by shade.
> The following is example code.
> {code:java}
> CREATE TABLE es6 (
> user_id STRING,
> user_name STRING,
> PRIMARYKEY (user_id) NOT ENFORCED
> ) WITH (
> 'connector' = 'elasticsearch-6',
> 'hosts' = 'http://localhost:9200',
> 'index' = 'users',
> 'document-type' = 'foo'
> );
> CREATE TABLE es7 (
> user_id STRING,
> user_name STRING,
> PRIMARYKEY (user_id) NOT ENFORCED
> ) WITH (
> 'connector' = 'elasticsearch-7',
> 'hosts' = 'http://localhost:9200',
> 'index' = 'users'
> );
> CREATE TABLE ods (
> user_id STRING,
> user_name STRING
> ) WITH (
> 'connector' = 'datagen'
> );
> INSERT INTO es6 SELECT user_id, user_name FROM ods;
> INSERT INTO es7 SELECT user_id, user_name FROM ods;{code}
>
> Inspired by PluginManager, PluginFileSystemFactory and ClassLoaderFixingFileSystem class.
> Could we create many ClassLoaderFixing* class to avoid class conflict. Such as ClassLoaderFixingDynamicTableFactory, ClassLoaderFixingSink or ClassLoaderFixingSinkFunction.
> If we use ClassLoader fixing, each call SinkFunction#invoke will switch ClassLoader by Thread#currentThread()#setContextClassLoader(). Does setContextClassLoader() has heavy overhead?
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)