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_r346287513
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/entrypoint/YarnJobClusterEntrypoint.java
 ##########
 @@ -61,10 +65,20 @@ protected String getRPCPortRange(Configuration 
configuration) {
        }
 
        @Override
-       protected DefaultDispatcherResourceManagerComponentFactory 
createDispatcherResourceManagerComponentFactory(Configuration configuration) {
+       protected DefaultDispatcherResourceManagerComponentFactory 
createDispatcherResourceManagerComponentFactory(Configuration configuration) 
throws IOException {
+               final YarnConfigOptions.UserJarInclusion userJarInclusion = 
configuration
 
 Review comment:
   We can avoid calling `tryFindUserLibDirectory()` twice. Also 
`tryFindUserLibDirectory().orElse(null)` looks awkward because at this point 
the user lib directory must be already present.
   
   ```suggestion
                final YarnConfigOptions.UserJarInclusion userJarInclusion = 
configuration
                        .getEnum(YarnConfigOptions.UserJarInclusion.class, 
YarnConfigOptions.CLASSPATH_INCLUDE_USER_JAR);
                final Optional<File> userLibDirectory = 
tryFindUserLibDirectory();
   
                checkState(
                        userJarInclusion != 
YarnConfigOptions.UserJarInclusion.DISABLED || userLibDirectory.isPresent(),
                        "The %s is set to %s. But the usrlib directory does not 
exist.",
                        YarnConfigOptions.CLASSPATH_INCLUDE_USER_JAR.key(),
                        YarnConfigOptions.UserJarInclusion.DISABLED);
   
                final File usrLibDir = userJarInclusion == 
YarnConfigOptions.UserJarInclusion.DISABLED ?
                        userLibDirectory.get() :
                        null;
   
                return 
DefaultDispatcherResourceManagerComponentFactory.createJobComponentFactory(
                        YarnResourceManagerFactory.getInstance(),
                        FileJobGraphRetriever.createFrom(configuration, 
usrLibDir));
   ```

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