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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -1369,46 +1369,96 @@ protected void validateEncryptionKeyInfo(OmBucketInfo 
bucketInfo, KeyArgs keyArg
   }
 
   /**
-   * Validates atomic rewrite conditions for conditional writes.
-   * <p>
-   * For If-None-Match: * (expectedDataGeneration = 
EXPECTED_GEN_CREATE_IF_NOT_EXISTS),
-   * the key must NOT exist.
-   * <p>
-   * For If-Match with a specific generation, the key must exist with matching 
updateID.
+   * Resolves conditional write state at request admission time.
    *
-   * @param dbKeyInfo the existing key info from the database (null if key 
doesn't exist)
-   * @param keyArgs the key arguments containing expected generation
-   * @throws OMException if validation fails
+   * This validates expected generations as admission-time preconditions and
+   * rewrites matching ETags into expected generations for commit-time checks.
    */
-  protected void validateAtomicRewrite(OmKeyInfo dbKeyInfo, KeyArgs keyArgs)
-      throws OMException {
+  protected KeyArgs resolveConditionalWriteAtAdmission(OmKeyInfo dbKeyInfo,

Review Comment:
   This resolveConditionalWriteAtAdmission is used in both pre-execute and 
validateAndUpdateCache, so AtAdmission seem not accurate. 
   
   BTW, OMKeyCreateRequest.preExecute doesn't call this 
resolveConditionalWriteAtAdmission, is it on purpose? 



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