jackjlli commented on a change in pull request #3671:  Make different PinotFS 
concrete classes have the same behaviors
URL: https://github.com/apache/incubator-pinot/pull/3671#discussion_r246877077
 
 

 ##########
 File path: 
pinot-hadoop-filesystem/src/main/java/com/linkedin/pinot/filesystem/HadoopPinotFS.java
 ##########
 @@ -139,6 +205,20 @@ public long length(URI fileUri) throws IOException {
     return retArray;
   }
 
+  private FileStatus[] listStatus(Path path, boolean recursive) throws 
IOException {
+    List<FileStatus> fileStatuses = new ArrayList<>();
+    FileStatus[] files = _hadoopFS.listStatus(path);
+    for (FileStatus file : files) {
+      fileStatuses.add(file);
+      if (file.isDirectory() && recursive) {
+        List<FileStatus> subFiles = Arrays.asList(listStatus(file.getPath(), 
true));
+        fileStatuses.addAll(subFiles);
+      }
+    }
+    FileStatus[] fileStatusesArr = new FileStatus[fileStatuses.size()];
 
 Review comment:
   The reason is that I'm not sure whether this API will be exposed in the 
future. Right now all the `listStatus` from `Hadoop FileSystem` return an 
FileStatus array. So I think it's best to follow the convention.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to