You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/11/04 15:48:47 UTC

[GitHub] [flink] guoweiM commented on a change in pull request #10076: [FLINK-14465][runtime] Let `StandaloneJobClusterEntrypoint` use user code class loader

guoweiM commented on a change in pull request #10076: [FLINK-14465][runtime] Let `StandaloneJobClusterEntrypoint` use user code class loader
URL: https://github.com/apache/flink/pull/10076#discussion_r342121125
 
 

 ##########
 File path: flink-container/src/main/java/org/apache/flink/container/entrypoint/ClassPathJobGraphRetriever.java
 ##########
 @@ -133,9 +138,18 @@ private String getJobClassNameOrScanClassPath() throws FlinkException {
 	}
 
 	private String scanClassPathForJobJar() throws IOException {
-		LOG.info("Scanning class path for job JAR");
-		JarFileWithEntryClass jobJar = JarManifestParser.findOnlyEntryClass(jarsOnClassPath.get());
-
+		final JarFileWithEntryClass jobJar;
+		if (getUserClassPaths().isEmpty()) {
+			LOG.info("Scanning system class path for job JAR");
+			jobJar = JarManifestParser.findOnlyEntryClass(jarsOnClassPath.get());
+		} else {
+			LOG.info("Scanning user class path for job JAR");
+			final List<File> userJars = getUserClassPaths()
+				.stream()
+				.map(url -> new File(url.getFile()))
+				.collect(Collectors.toList());
+			jobJar = JarManifestParser.findOnlyEntryClass(userJars);
+		}
 
 Review comment:
   Do you mean that we should search for an entry class both in the user classpath and system classpath?
   I have a little concern about that. If there is only an entry class in the system class and we use it. I think it leads to the jars in the job directory will not be used. It is a little weird that the user provides some jars but could not be used.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services