TisonKun commented on a change in pull request #10187: [FLINK-13938][yarn] 
Enable configure shared libraries on YARN
URL: https://github.com/apache/flink/pull/10187#discussion_r346650407
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
 ##########
 @@ -1237,6 +1262,47 @@ public FileVisitResult visitFile(java.nio.file.Path 
file, BasicFileAttributes at
                return classPaths;
        }
 
+       private List<String> registerSharedLibs(
+                       Collection<Path> sharedLibs,
+                       FileSystem fs,
+                       List<Path> remotePaths,
+                       Map<String, LocalResource> localResources,
+                       StringBuilder envShipFileList) throws IOException {
+               List<String> classPaths = new ArrayList<>();
+
+               for (Path sharedLibPath : sharedLibs) {
+                       if (fs.isFile(sharedLibPath)) {
+                               String classpath = 
setupSharedLib(sharedLibPath, fs, remotePaths, localResources, envShipFileList);
+                               classPaths.add(classpath);
+                       } else { // directory
+                               RemoteIterator<LocatedFileStatus> i = 
fs.listFiles(sharedLibPath, true);
+                               while (i.hasNext()) {
+                                       LocatedFileStatus fileStatus = i.next();
+                                       if (fileStatus.isFile()) {
+                                               String classpath = 
setupSharedLib(fileStatus.getPath(), fs, remotePaths, localResources, 
envShipFileList);
 
 Review comment:
   Here we flatten all files in the root relative path of program. Maybe it is 
better we keep the directory layout. Locally changed and verifying...

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