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/19 01:20:33 UTC

[GitHub] [flink] TisonKun commented on a change in pull request #10152: [FLINK-14466][runtime] Let YarnJobClusterEntrypoint use user code class loader

TisonKun commented on a change in pull request #10152: [FLINK-14466][runtime] Let YarnJobClusterEntrypoint use user code class loader
URL: https://github.com/apache/flink/pull/10152#discussion_r347690605
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/component/FileJobGraphRetriever.java
 ##########
 @@ -45,26 +51,39 @@
 	@Nonnull
 	private final String jobGraphFile;
 
-	public FileJobGraphRetriever(@Nonnull String jobGraphFile) {
+	public FileJobGraphRetriever(@Nonnull String jobGraphFile, @Nullable File usrLibDir) throws IOException {
+		super(usrLibDir);
 		this.jobGraphFile = jobGraphFile;
 	}
 
 	@Override
 	public JobGraph retrieveJobGraph(Configuration configuration) throws FlinkException {
-		File fp = new File(jobGraphFile);
+		final File fp = new File(jobGraphFile);
 
 		try (FileInputStream input = new FileInputStream(fp);
 			ObjectInputStream obInput = new ObjectInputStream(input)) {
-
-			return (JobGraph) obInput.readObject();
+			final JobGraph jobGraph = (JobGraph) obInput.readObject();
+			addUserClassPathsToJobGraph(jobGraph);
+			return jobGraph;
 		} catch (FileNotFoundException e) {
 			throw new FlinkException("Could not find the JobGraph file.", e);
 		} catch (ClassNotFoundException | IOException e) {
 			throw new FlinkException("Could not load the JobGraph from file.", e);
 		}
 	}
 
-	public static FileJobGraphRetriever createFrom(Configuration configuration) {
-		return new FileJobGraphRetriever(configuration.getString(JOB_GRAPH_FILE_PATH));
+	private void addUserClassPathsToJobGraph(JobGraph jobGraph) {
+		final List<URL> classPaths = new ArrayList<>();
+
+		if (jobGraph.getClasspaths() != null) {
 
 Review comment:
   FYI we can address this null checker in FLINK-14839. It is beyond the scope of this pr, but you can take a look at that JIRA since I think you will get the idea there.

----------------------------------------------------------------
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