This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new f269ccbd4a [Fix-13989] Fix resource center path validation (#14021)
f269ccbd4a is described below

commit f269ccbd4a494ef63fb82d7160bfebb4dfacbdf2
Author: liyou <[email protected]>
AuthorDate: Sat May 6 16:59:29 2023 +0800

    [Fix-13989] Fix resource center path validation (#14021)
---
 .../plugin/storage/hdfs/HdfsStorageOperator.java              | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java
 
b/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java
index ba5b3601f3..79b925fd56 100644
--- 
a/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java
+++ 
b/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java
@@ -473,7 +473,11 @@ public class HdfsStorageOperator implements Closeable, 
StorageOperate {
         // TODO: add hdfs prefix getFile
         List<StorageEntity> storageEntityList = new ArrayList<>();
         try {
-            FileStatus[] fileStatuses = fs.listStatus(new Path(path));
+            Path filePath = new Path(path);
+            if (!fs.exists(filePath)) {
+                return storageEntityList;
+            }
+            FileStatus[] fileStatuses = fs.listStatus(filePath);
 
             // transform FileStatusArray into the StorageEntity List
             for (FileStatus fileStatus : fileStatuses) {
@@ -756,9 +760,10 @@ public class HdfsStorageOperator implements Closeable, 
StorageOperate {
     private static final class YarnHAAdminUtils {
 
         /**
-         *  get active resourcemanager node
+         * get active resourcemanager node
+         *
          * @param protocol http protocol
-         * @param rmIds yarn ha ids
+         * @param rmIds    yarn ha ids
          * @return yarn active node
          */
         public static String getActiveRMName(String protocol, String rmIds) {

Reply via email to