Skip to content

Commit f269ccb

Browse files
authored
[Fix-13989] Fix resource center path validation (#14021)
1 parent 76f33be commit f269ccb

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs

‎dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,11 @@ public List<StorageEntity> listFilesStatus(String path, String defaultPath, Stri
473473
// TODO: add hdfs prefix getFile
474474
List<StorageEntity> storageEntityList = new ArrayList<>();
475475
try {
476-
FileStatus[] fileStatuses = fs.listStatus(new Path(path));
476+
Path filePath = new Path(path);
477+
if (!fs.exists(filePath)) {
478+
return storageEntityList;
479+
}
480+
FileStatus[] fileStatuses = fs.listStatus(filePath);
477481

478482
// transform FileStatusArray into the StorageEntity List
479483
for (FileStatus fileStatus : fileStatuses) {
@@ -756,9 +760,10 @@ public void close() throws IOException {
756760
private static final class YarnHAAdminUtils {
757761

758762
/**
759-
* get active resourcemanager node
763+
* get active resourcemanager node
764+
*
760765
* @param protocol http protocol
761-
* @param rmIds yarn ha ids
766+
* @param rmIds yarn ha ids
762767
* @return yarn active node
763768
*/
764769
public static String getActiveRMName(String protocol, String rmIds) {

0 commit comments

Comments
 (0)