sreejasahithi commented on code in PR #10045:
URL: https://github.com/apache/ozone/pull/10045#discussion_r3039761983


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -134,31 +130,22 @@ public Response get(
         return listMultipartUploads(bucketName, prefix, keyMarker, 
uploadIdMarker, maxUploads);
       }
 
-      maxKeys = validateMaxKeys(maxKeys);
-
-      if (prefix == null) {
-        prefix = "";
-      }
-
-      // Assign marker to startAfter. for the compatibility of aws api v1
-      if (startAfter == null && marker != null) {
-        startAfter = marker;
-      }
+      // Actual bucket processing starts here
+      // Validate and prepare parameters
+      BucketListingContext listingContext = validateAndPrepareParameters(
+          bucketName, delimiter, encodingType, marker, maxKeys, prefix, 
+          continueToken, startAfter);
 
-      // If continuation token and start after both are provided, then we
-      // ignore start After
-      String prevKey = continueToken != null ? decodedToken.getLastKey()
-          : startAfter;
+      // Initialize response object
+      ListObjectResponse response = initializeListObjectResponse(
+          bucketName, delimiter, encodingType, marker, maxKeys, prefix, 
+          continueToken, startAfter);

Review Comment:
   Here maxKeys is initialized from the query parameters (e.g., a user requests 
5000), validateAndPrepareParameters is called. Inside this method, maxKeys is 
capped via validateMaxKeys(maxKeys) (e.g., capped to 1000). This capped value 
is stored inside the BucketListingContext, the maxKeys variable back in the 
get() method is not updated. It remains 5000. initializeListObjectResponse is 
called using the original maxKeys (5000).The response object now explicitly 
states <MaxKeys>5000</MaxKeys>.
   
   I think if we pass listingContext.getMaxKeys() not the local `maxKeys` to 
initializeListObjectResponse this issue would not be seen.
   
   Could you confirm whether that’s intentional or something we should align?
   



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