qinf commented on code in PR #23219:
URL: https://github.com/apache/flink/pull/23219#discussion_r1303713063


##########
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java:
##########
@@ -202,16 +204,27 @@ public YarnClusterDescriptor(
         this.nodeLabel = 
flinkConfiguration.getString(YarnConfigOptions.NODE_LABEL);
     }
 
-    private Optional<List<File>> decodeFilesToShipToCluster(
+    private Optional<List<Path>> decodeFilesToShipToCluster(
             final Configuration configuration, final 
ConfigOption<List<String>> configOption) {
         checkNotNull(configuration);
         checkNotNull(configOption);
 
-        final List<File> files =
-                ConfigUtils.decodeListFromConfig(configuration, configOption, 
File::new);
+        List<Path> files = ConfigUtils.decodeListFromConfig(configuration, 
configOption, Path::new);
+        files = 
files.stream().map(this::enrichPathSchemaIfNeeded).collect(Collectors.toList());
         return files.isEmpty() ? Optional.empty() : Optional.of(files);
     }
 
+    private Path enrichPathSchemaIfNeeded(Path path) {
+        if (isWithoutSchema(path)) {
+            return new Path(new File(path.toString()).toURI());
+        }
+        return path;
+    }
+
+    private boolean isWithoutSchema(Path path) {
+        return StringUtils.isNullOrWhitespaceOnly(path.toUri().getScheme());
+    }

Review Comment:
   @1996fanrui updated.



##########
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java:
##########
@@ -202,16 +204,27 @@ public YarnClusterDescriptor(
         this.nodeLabel = 
flinkConfiguration.getString(YarnConfigOptions.NODE_LABEL);
     }
 
-    private Optional<List<File>> decodeFilesToShipToCluster(
+    private Optional<List<Path>> decodeFilesToShipToCluster(
             final Configuration configuration, final 
ConfigOption<List<String>> configOption) {
         checkNotNull(configuration);
         checkNotNull(configOption);
 
-        final List<File> files =
-                ConfigUtils.decodeListFromConfig(configuration, configOption, 
File::new);
+        List<Path> files = ConfigUtils.decodeListFromConfig(configuration, 
configOption, Path::new);
+        files = 
files.stream().map(this::enrichPathSchemaIfNeeded).collect(Collectors.toList());
         return files.isEmpty() ? Optional.empty() : Optional.of(files);
     }
 
+    private Path enrichPathSchemaIfNeeded(Path path) {
+        if (isWithoutSchema(path)) {
+            return new Path(new File(path.toString()).toURI());

Review Comment:
   @1996fanrui updated.



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