[ https://issues.apache.org/jira/browse/FLINK-35281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated FLINK-35281: ----------------------------------- Labels: pull-request-available (was: ) > FlinkEnvironmentUtils#addJar add each jar only once > --------------------------------------------------- > > Key: FLINK-35281 > URL: https://issues.apache.org/jira/browse/FLINK-35281 > Project: Flink > Issue Type: Bug > Components: Flink CDC > Affects Versions: cdc-3.1.0 > Reporter: Hongshun Wang > Priority: Not a Priority > Labels: pull-request-available > Fix For: cdc-3.2.0 > > > Current org.apache.flink.cdc.composer.flink.FlinkEnvironmentUtils#addJar will > be invoked for each source and sink. > {code:java} > public static void addJar(StreamExecutionEnvironment env, URL jarUrl) { > try { > Class<StreamExecutionEnvironment> envClass = > StreamExecutionEnvironment.class; > Field field = envClass.getDeclaredField("configuration"); > field.setAccessible(true); > Configuration configuration = ((Configuration) field.get(env)); > List<String> jars = > configuration.getOptional(PipelineOptions.JARS).orElse(new > ArrayList<>()); > jars.add(jarUrl.toString()); > configuration.set(PipelineOptions.JARS, jars); > } catch (Exception e) { > throw new RuntimeException("Failed to add JAR to Flink execution > environment", e); > } {code} > if multiple source or sink share same jar, the par path will be added > repeatly. -- This message was sent by Atlassian Jira (v8.20.10#820010)