chungen0126 commented on code in PR #11020:
URL: https://github.com/apache/ozone/pull/11020#discussion_r3891353652
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectAttributesHandler.java:
##########
@@ -170,4 +173,89 @@ private GetObjectAttributesResponse buildResponse(OzoneKey
key, Set<String> requ
return resp;
}
+
+ /**
+ * Builds the {@link GetObjectAttributesResponse.ObjectParts} element for a
completed
+ * multipart object, including per-part sizes and optional pagination.
+ *
+ * <p>When {@code x-amz-max-parts} is omitted, the page size defaults to
1000, matching ListParts.
+ * Each part size is fetched via a part-aware {@code headS3Object} call (one
OM RPC per part
+ * in the current page).
+ */
+ private GetObjectAttributesResponse.ObjectParts buildObjectParts(String
bucketName,
+ String keyPath, int totalPartsCount, String resource) throws
IOException, OS3Exception {
+ Integer maxPartsHeader = parseMaxPartsHeader(resource);
+ Integer partNumberMarker = parsePartNumberMarkerHeader(resource);
+ int marker = partNumberMarker != null ? partNumberMarker : 0;
+ int maxParts = maxPartsHeader != null
+ ? maxPartsHeader : GET_OBJECT_ATTRIBUTES_MAX_PARTS_LIMIT;
Review Comment:
We should avoid these explicit null checks Please update the parsing methods
to either return an Optional<Integer>, or accept the default value as a
parameter to return a primitive int. This is safer and cleaner.
--
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]