Browse Source

[Fix-13989] Fix resource center path validation (#14021)

3.2.0-release
liyou 2 years ago committed by GitHub
parent
commit
f269ccbd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java

11
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) {

Loading…
Cancel
Save