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

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/component/FileJobGraphRetriever.java
 ##########
 @@ -55,16 +62,28 @@ public JobGraph retrieveJobGraph(Configuration 
configuration) throws FlinkExcept
 
                try (FileInputStream input = new FileInputStream(fp);
                        ObjectInputStream obInput = new 
ObjectInputStream(input)) {
+                       final JobGraph jobGraph = (JobGraph) 
obInput.readObject();
 
-                       return (JobGraph) obInput.readObject();
+                       final List<URL> userClassPaths = new ArrayList<>();
+                       if (jobGraph.getClasspaths() != null) {
+                               userClassPaths.addAll(jobGraph.getClasspaths());
+                       }
+                       userClassPaths.addAll(getUserClassPaths());
+                       jobGraph.setClasspaths(userClassPaths);
+                       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));
+       public static FileJobGraphRetriever createFrom(Configuration 
configuration) throws IOException {
+               return new 
FileJobGraphRetriever(configuration.getString(JOB_GRAPH_FILE_PATH), null);
 
 Review comment:
   To avoid code duplication it would be better to call 
`createFrom(configuration, null)`. You would also get a free null check this 
way.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to