kerneltime commented on code in PR #3379:
URL: https://github.com/apache/ozone/pull/3379#discussion_r864339871


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -1873,18 +1874,27 @@ public List<OzoneFileStatus> listStatusFSO(OmKeyArgs 
args, boolean recursive,
   private List<OzoneFileStatus> buildFinalStatusList(
       Map<String, OzoneFileStatus> cacheFileMap,
       Map<String, OzoneFileStatus> cacheDirMap, OmKeyArgs omKeyArgs,
-      String clientAddress)
+      String clientAddress, long numEntries)
       throws IOException {
     List<OmKeyInfo> keyInfoList = new ArrayList<>();
     List<OzoneFileStatus> fileStatusFinalList = new ArrayList<>();
 
+    long countEntries = 0;
     for (OzoneFileStatus fileStatus : cacheFileMap.values()) {
       fileStatusFinalList.add(fileStatus);
       keyInfoList.add(fileStatus.getKeyInfo());
+      countEntries++;
+      if (countEntries >= numEntries) {

Review Comment:
   Do the keys in the `fileStatusFinalList` be a sum of both file and dir 
caches sorted and then truncated to the numEntries? I think the overall code 
for `listStatusFSO` needs to be revisited. 



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