wangyang0918 commented on a change in pull request #18531:
URL: https://github.com/apache/flink/pull/18531#discussion_r801340286



##########
File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
##########
@@ -1685,6 +1699,35 @@ void addLibFoldersToShipFiles(Collection<File> 
effectiveShipFiles) {
         }
     }
 
+    @VisibleForTesting
+    void addUsrLibFolderToShipFiles(
+            Collection<File> effectiveShipFiles, Collection<File> 
systemShipFiles) {
+        // Add usrlib folder to the ship files if it exists
+        // Classes in the folder will be loaded by UserClassLoader if 
CLASSPATH_INCLUDE_USER_JAR is
+        // DISABLED.
+        final Optional<File> usrLibDir = getLocalUsrLibDirectory();
+
+        if (usrLibDir.isPresent()) {
+            File usrLibDirFile = usrLibDir.get();
+            if (usrLibDirFile.isDirectory()) {
+                checkArgument(

Review comment:
       Except for the naming, I do not think the 
`ClusterEntrypointUtils.tryFindUserLibDirectory()` should only work in the 
cluster side. If a user configure a customized `FLINK_LIB_DIR`, then he/she 
should also have the `usrlib` in such location. I think it is reasonable.
   
   For the naming, maybe we could have the `UserLibUtils.java`, which contains 
all the utility methods for `usrlib`. 
   
   Please note that `FLINK_LIB_DIR` will be exported in `bin/config.sh` 
automatically if not configured.




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

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to