kl0u commented on a change in pull request #12170:
URL: https://github.com/apache/flink/pull/12170#discussion_r425777590



##########
File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnApplicationFileUploader.java
##########
@@ -300,19 +310,22 @@ public FileVisitResult visitFile(java.nio.file.Path file, 
BasicFileAttributes at
 
                final ArrayList<String> classPaths = new ArrayList<>();
                providedSharedLibs.forEach(
-                       (fileName, fileStatus) -> {
-                               localResources.put(
-                                       fileName,
-                                       Utils.registerLocalResource(
-                                               fileStatus.getPath(),
-                                               fileStatus.getLen(),
-                                               
fileStatus.getModificationTime(),
-                                               
LocalResourceVisibility.PUBLIC));
-
-                               if (!isFlinkDistJar(fileName)) {
-                                       classPaths.add(fileName);
-                               }
-                       });
+                               (fileName, fileStatus) -> {
+                                       final Path filePath = 
fileStatus.getPath();
+                                       LOG.debug("Using remote file {} to 
register local resource", filePath);
+
+                                       final YarnLocalResourceDescriptor 
descriptor = YarnLocalResourceDescriptor
+                                                       
.fromFileStatus(fileName, fileStatus, LocalResourceVisibility.PUBLIC);
+                                       localResources.put(fileName, 
descriptor.toLocalResource());
+                                       remotePaths.add(filePath);
+                                       envShipResourceList.add(descriptor);
+
+                                       if (!isFlinkDistJar(fileName) && 
!isPlugin(fileStatus.getPath())) {

Review comment:
       You mean use the `filePath.getName()`?




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


Reply via email to