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



##########
File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnApplicationFileUploader.java
##########
@@ -438,6 +446,18 @@ private static boolean isPlugin(Path path) {
         return false;
     }
 
+    private static boolean isUsrLib(Path path) {

Review comment:
       I suggest to introduce the `isUsrLibDirIncludedInProvidedLib` instead 
and then `checkArgument` in the constructor of `YarnApplicationFileUploader`. 
Because the files in the provided lib will be relativized, we just need to 
check the name of provided lib.
   
   ```
       private boolean isUsrLibDirIncludedInProvidedLib(final List<Path> 
providedLibDirs)
               throws IOException {
           for (Path path : providedLibDirs) {
               final FileStatus fileStatus = fileSystem.getFileStatus(path);
               if (fileStatus.isDirectory()
                       && 
ConfigConstants.DEFAULT_FLINK_USR_LIB_DIR.equals(path.getName())) {
                   return true;
               }
           }
           return false;
       }
   ```
    




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to