CTTY commented on code in PR #11805:
URL: https://github.com/apache/hudi/pull/11805#discussion_r1744813199


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/ListingBasedRollbackStrategy.java:
##########
@@ -272,17 +287,30 @@ private FileStatus[] 
fetchFilesFromCommitMetadata(HoodieInstant instantToRollbac
    * @param partitionPath
    * @param basePath
    * @param baseFileExtension
-   * @param fs
+   * @param storage
    * @return
    * @throws IOException
    */
-  private FileStatus[] fetchFilesFromListFiles(HoodieInstant 
instantToRollback, String partitionPath, String basePath,
-                                               String baseFileExtension, 
FileSystem fs)
-      throws IOException {
-    SerializablePathFilter pathFilter = 
getSerializablePathFilter(baseFileExtension, instantToRollback.getTimestamp());
-    Path[] filePaths = listFilesToBeDeleted(basePath, partitionPath);
-
-    return fs.listStatus(filePaths, pathFilter);
+  private List<StoragePathInfo> fetchFilesFromListFiles(HoodieInstant 
instantToRollback,
+                                                        String partitionPath,
+                                                        String basePath,
+                                                        String 
baseFileExtension,
+                                                        HoodieStorage storage) 
{
+    StoragePathFilter pathFilter = getPathFilter(baseFileExtension, 
instantToRollback.getTimestamp());
+    StoragePath[] filePaths = listFilesToBeDeleted(basePath, partitionPath);
+
+    return Arrays.stream(filePaths)
+        .map(path -> {
+          try {
+            return storage.listDirectEntries(path, pathFilter);
+          } catch (IOException ioe) {
+            LOG.error("Failed to get StoragePathInfo for " + path.toString(), 
ioe);
+          }
+          return null;
+        })

Review Comment:
   I added a new API `listDirectEntries(List<StoragePath>, StoragePathFilter)`



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

Reply via email to