Skip to content

HDDS-14590. Extract MultipartKeyHandler for MPU object operations#9768

Open
Russole wants to merge 5 commits intoapache:masterfrom
Russole:HDDS-14590
Open

HDDS-14590. Extract MultipartKeyHandler for MPU object operations#9768
Russole wants to merge 5 commits intoapache:masterfrom
Russole:HDDS-14590

Conversation

@Russole
Copy link
Contributor

@Russole Russole commented Feb 15, 2026

What changes were proposed in this pull request?

  • Create new ObjectOperationHandler subclass MultipartKeyHandler.
  • Add it to ObjectEndpoint's handler chain before this.
  • Move MPU-related methods (except POST handlers) from ObjectEndpoint and implement ObjectOperationHandler methods using these methods.
  • Move MPU-related metrics calls to MultipartKeyHandler.
  • Fix incorrect failure metrics count when a GET key request fails.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14590

How was this patch tested?

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Russole for the patch, mostly LGTM.

Comment on lines 102 to 110
/**
* Abort multipart upload request.
* @param bucket
* @param key
* @param uploadId
* @return Response
* @throws IOException
* @throws OS3Exception
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this kind "junk" of javadoc:

  • description is mandatory for @param and @throws, but missing
  • @return Response does not provide any additional information over return type in the method signature

*/
private Response listParts(OzoneBucket ozoneBucket, String key, String uploadId,
int partNumberMarker, int maxParts,
org.apache.hadoop.ozone.audit.AuditLogger.PerformanceStringBuilder perf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add import for PerformanceStringBuilder.


final int maxParts = queryParams().getInt(QueryParams.MAX_PARTS, 1000);
final String partNumberMarker = queryParams().get(QueryParams.PART_NUMBER_MARKER);
final long startNanos = context.getStartNanos();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's inline startNanos (call getStartNanos() when updating metrics).

/**
* Handles MPU (Multipart Upload) non-POST operations for object key endpoint.
*/
public class MultipartKeyHandler extends ObjectOperationHandler {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
public class MultipartKeyHandler extends ObjectOperationHandler {
class MultipartKeyHandler extends ObjectOperationHandler {

@Russole
Copy link
Contributor Author

Russole commented Feb 16, 2026

Thanks @adoroszlai for the review.
I’ve updated the patch based on the comments.

@Russole Russole requested a review from adoroszlai February 16, 2026 14:44
@adoroszlai
Copy link
Contributor

I’ve updated the patch based on the comments.

Thanks for updating the patch. Note that there is a checkstyle problem:

hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/MultipartKeyHandler.java
 39: Wrong lexicographical order for 'org.apache.hadoop.ozone.audit.AuditLogger.PerformanceStringBuilder' import. Should be before 'org.apache.hadoop.ozone.s3.util.S3StorageType'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants