swamirishi commented on code in PR #7431:
URL: https://github.com/apache/ozone/pull/7431#discussion_r1846062699


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -937,25 +937,27 @@ public List<FileStatusAdapter> listStatusAdapter(Path f) 
throws IOException {
     LinkedList<FileStatusAdapter> statuses = new LinkedList<>();
     List<FileStatusAdapter> tmpStatusList;
     String startPath = "";
-
+    int entriesAdded;
     do {
       tmpStatusList =
           adapter.listStatus(pathToKey(f), false, startPath,
               numEntries, uri, workingDir, getUsername());
-
+      entriesAdded = 0;
       if (!tmpStatusList.isEmpty()) {
         if (startPath.isEmpty() || !statuses.getLast().getPath().toString()
             .equals(tmpStatusList.get(0).getPath().toString())) {
           statuses.addAll(tmpStatusList);
+          entriesAdded += tmpStatusList.size();
         } else {
           statuses.addAll(tmpStatusList.subList(1, tmpStatusList.size()));
+          entriesAdded += tmpStatusList.size() - 1;

Review Comment:
   The logic before if you check was expecting that the server always returns 
atleast request.pageSize if there are more entries to be returned. Now with the 
server side limit, the server can return lesser entries even if there are more 
entries on the server side. So the client has to make an extra call to the 
server one more time to check if there are more entries. We can have an 
improvement on the server side to return this in the response if the response 
is truncated. We can file a jira for this and file as an improvement.



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


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

Reply via email to