You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "krishnaasawa1 (via GitHub)" <gi...@apache.org> on 2023/05/18 14:15:43 UTC

[GitHub] [ozone] krishnaasawa1 commented on a diff in pull request #4724: HDDS-8502. Recon - getContainers API is not giving expected response with prevKey.

krishnaasawa1 commented on code in PR #4724:
URL: https://github.com/apache/ozone/pull/4724#discussion_r1197881330


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -141,10 +140,18 @@ public Response getContainers(
       // Send back an empty response
       return Response.status(Response.Status.NOT_ACCEPTABLE).build();
     }
+    if (prevKey > 0) {

Review Comment:
   prevkey will be 0 at the beginning . Comment of this method it self define "prevKey the containerID after which results are returned.
      *                start containerID, >=0"
   if so this check is not required else even 1st call will not go thru.  
   prevKey < 0 is already taken care above.



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -141,10 +140,18 @@ public Response getContainers(
       // Send back an empty response
       return Response.status(Response.Status.NOT_ACCEPTABLE).build();
     }
+    if (prevKey > 0) {
+      // Increase the limit by 1 to fetch one additional container
+      // since we are excluding the container with the same ID as prevKey
+      limit = limit + 1;

Review Comment:
   Make sense if this works  ,  this will minimize the code change here.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org