chungen0126 commented on code in PR #10183:
URL: https://github.com/apache/ozone/pull/10183#discussion_r3186222852


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java:
##########
@@ -409,6 +404,40 @@ protected OMClientResponse getOmClientResponse(String 
multipartKey,
         getBucketLayout(), omBucketInfo, bucketId);
   }
 
+  private KeyArgs resolveConditionalWrite(
+      OMMetadataManager omMetadataManager, KeyArgs keyArgs)
+      throws IOException {
+    if (!keyArgs.hasExpectedETag()
+        && !keyArgs.hasExpectedDataGeneration()) {
+      return keyArgs;
+    }
+
+    String multipartKey = omMetadataManager.getMultipartKey(
+        keyArgs.getVolumeName(),
+        keyArgs.getBucketName(), keyArgs.getKeyName(),
+        keyArgs.getMultipartUploadID());
+    if (omMetadataManager.getMultipartInfoTable().get(multipartKey) == null) {
+      throw new OMException(
+          failureMessage(keyArgs.getVolumeName(), keyArgs.getBucketName(),
+              keyArgs.getKeyName()),
+          OMException.ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR);
+    }
+
+    OmKeyInfo existingKeyInfo = getExistingKeyInfo(
+        omMetadataManager, keyArgs);

Review Comment:
   Calling rocksDB inside `preExecute` is not a big problem. We also check ACLs 
inside `preExecute`, it also calls rocksDB.



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