Github user mxm commented on a diff in the pull request:
https://github.com/apache/flink/pull/1214#discussion_r43609625
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamContextEnvironment.java
---
@@ -36,28 +31,16 @@
private static final Logger LOG =
LoggerFactory.getLogger(StreamContextEnvironment.class);
- private final List<URL> jars;
-
- private final List<URL> classpaths;
-
- private final Client client;
+ private final ContextEnvironment ctx;
private final ClassLoader userCodeClassLoader;
-
- private final boolean wait;
- protected StreamContextEnvironment(Client client, List<URL> jars,
List<URL> classpaths, int parallelism,
- boolean wait) {
- this.client = client;
- this.jars = jars;
- this.classpaths = classpaths;
- this.wait = wait;
-
- this.userCodeClassLoader =
JobWithJars.buildUserCodeClassLoader(jars, classpaths,
- getClass().getClassLoader());
+ protected StreamContextEnvironment(ContextEnvironment ctx) {
+ this.ctx = ctx;
+ this.userCodeClassLoader =
JobWithJars.buildUserCodeClassLoader(ctx.getJars(), ctx.getClasspaths(),
getClass().getClassLoader());
--- End diff --
Classloaders rules are the same for streaming and batch. We should try to
reuse code when possible. So probably a good idea to delgate this to the Client
class.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---