ruanwenjun commented on code in PR #13435:
URL:
https://github.com/apache/dolphinscheduler/pull/13435#discussion_r1082495622
##########
dolphinscheduler-storage-plugin/dolphinscheduler-storage-oss/src/main/java/org/apache/dolphinscheduler/plugin/storage/oss/OssStorageOperator.java:
##########
@@ -288,19 +309,171 @@ public ResUploadType returnStorageType() {
@Override
public List<StorageEntity> listFilesStatusRecursively(String path, String
defaultPath, String tenantCode,
ResourceType type) {
- return null;
+ List<StorageEntity> storageEntityList = new ArrayList<>();
+
+ LinkedList<StorageEntity> foldersToFetch = new LinkedList<>();
Review Comment:
It's better to add initialize path in `foldersToFetch`, and then you only
need to loop the `foldersToFetch`.
```java
while (!foldersToFetch.isEmpty()) {
String pathToExplore = foldersToFetch.pop().getFullName();
try {
List<StorageEntity> tempList = listFilesStatus(pathToExplore,
defaultPath, tenantCode, type);
for (StorageEntity temp : tempList) {
if (temp.isDirectory()) {
foldersToFetch.add(temp);
}
}
storageEntityList.addAll(tempList);
} catch (Exception e) {
logger.error("error while listing files status recursively, path:
{}", pathToExplore, e);
}
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]