This is an automated email from the ASF dual-hosted git repository. aljoscha pushed a commit to branch release-1.9 in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.9 by this push: new e47b15a [FLINK-15844][client] Expose JobWithJars.buildUserCodeClassLoader without Configuration to fix backwards compatibility e47b15a is described below commit e47b15a6ead9da2fd12e2d80fd4befd0915b1ddf Author: Ismaël Mejía <ieme...@gmail.com> AuthorDate: Sat Feb 1 13:50:34 2020 +0100 [FLINK-15844][client] Expose JobWithJars.buildUserCodeClassLoader without Configuration to fix backwards compatibility --- .../apache/flink/client/program/JobWithJars.java | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/flink-clients/src/main/java/org/apache/flink/client/program/JobWithJars.java b/flink-clients/src/main/java/org/apache/flink/client/program/JobWithJars.java index 838f45d..7bbca53 100644 --- a/flink-clients/src/main/java/org/apache/flink/client/program/JobWithJars.java +++ b/flink-clients/src/main/java/org/apache/flink/client/program/JobWithJars.java @@ -133,7 +133,23 @@ public class JobWithJars { } } + /** + * @deprecated Use {@link #buildUserCodeClassLoader(List, List, ClassLoader, Configuration)} + */ + @Deprecated + public static ClassLoader buildUserCodeClassLoader(List<URL> jars, List<URL> classpaths, ClassLoader parent) { + return FlinkUserCodeClassLoaders.parentFirst(extractUrls(jars, classpaths), parent); + } + public static ClassLoader buildUserCodeClassLoader(List<URL> jars, List<URL> classpaths, ClassLoader parent, Configuration configuration) { + URL[] urls = extractUrls(jars, classpaths); + FlinkUserCodeClassLoaders.ResolveOrder resolveOrder = FlinkUserCodeClassLoaders.ResolveOrder + .fromString(configuration.getString(CoreOptions.CLASSLOADER_RESOLVE_ORDER)); + String[] parentFirstPattern = CoreOptions.getParentFirstLoaderPatterns(configuration); + return FlinkUserCodeClassLoaders.create(resolveOrder, urls, parent, parentFirstPattern); + } + + private static URL[] extractUrls(List<URL> jars, List<URL> classpaths) { URL[] urls = new URL[jars.size() + classpaths.size()]; for (int i = 0; i < jars.size(); i++) { urls[i] = jars.get(i); @@ -141,9 +157,6 @@ public class JobWithJars { for (int i = 0; i < classpaths.size(); i++) { urls[i + jars.size()] = classpaths.get(i); } - FlinkUserCodeClassLoaders.ResolveOrder resolveOrder = FlinkUserCodeClassLoaders.ResolveOrder - .fromString(configuration.getString(CoreOptions.CLASSLOADER_RESOLVE_ORDER)); - String[] parentFirstPattern = CoreOptions.getParentFirstLoaderPatterns(configuration); - return FlinkUserCodeClassLoaders.create(resolveOrder, urls, parent, parentFirstPattern); + return urls; } }