fmorg-git commented on code in PR #11426:
URL: https://github.com/apache/ozone/pull/11426#discussion_r4253920817
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -109,7 +109,7 @@ Response handleGetRequest(S3RequestContext context, String
bucketName) throws IO
final String delimiter = queryParams().containsKey(QueryParams.DELIMITER) ?
queryParams().get(QueryParams.DELIMITER) : null;
final String encodingType = queryParams().get(QueryParams.ENCODING_TYPE);
- final String marker = queryParams().get(QueryParams.MARKER);
+ final String marker = getListMarker();
Review Comment:
should `start-after`, `continuation-token`, `fetch-owner` similarly be
adjusted depending on whether ListObjectVersions is called?
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -252,7 +252,28 @@ Response handleGetRequest(S3RequestContext context, String
bucketName) throws IO
context.getPerf().appendCount(keyCount);
context.getPerf().appendOpLatencyNanos(opLatencyNs);
response.setKeyCount(keyCount);
- return Response.ok(response).build();
+ return Response.ok(toListResult(response)).build();
+ }
+
+ private boolean isListObjectVersions() {
+ return queryParams().get(QueryParams.VERSIONS) != null;
+ }
+
+ /** ListObjectVersions lists the same keys as ListObjects (V1), but
paginates with key-marker instead of marker. */
+ private String getListMarker() throws OS3Exception {
+ if (!isListObjectVersions()) {
+ return queryParams().get(QueryParams.MARKER);
+ }
+ final String keyMarker = queryParams().get(QueryParams.KEY_MARKER);
+ if (StringUtils.isEmpty(keyMarker) &&
StringUtils.isNotEmpty(queryParams().get(QueryParams.VERSION_ID_MARKER))) {
Review Comment:
should we also check that QueryParams.VERSION_ID_MARKER is supported,
meaning it is the `"null"` version?
--
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]