kerneltime commented on code in PR #6385:
URL: https://github.com/apache/ozone/pull/6385#discussion_r1549976002


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java:
##########
@@ -469,6 +469,30 @@ public OzoneOutputStream createKey(String key, long size,
         .createKey(volumeName, name, key, size, replicationConfig, 
keyMetadata);
   }
 
+  /**
+   * Overwrite an existing key using optimistic locking. The existingKey must 
exist in Ozone to allow
+   * the new key to be created with the same name. Additionally, the existing 
Key must not have been
+   * modified since the time it's details were read. This is controlled by the 
updateID
+   * field in the existing Key. If the key is replaced or updated the updateID 
will change. If the
+   * updateID has changed since the existing Key was read, either the initial 
key create will fail,
+   * or the key will fail to commit after the data has been written as the 
checks are carried out
+   * both a key open and commit time.
+   *
+   * For now this feature only works on Object Store Buckets. FSO support will 
be added a later.
+   *
+   * @param existingKey       Name of the key to be created.
+   * @param replicationConfig Replication configuration.
+   * @return OzoneOutputStream to which the data has to be written.
+   * @throws IOException
+   */
+  public OzoneOutputStream overwriteKey(OzoneKeyDetails existingKey, 
ReplicationConfig replicationConfig)

Review Comment:
   ```suggestion
     public OzoneOutputStream atomicUpdateObject(UpdateID oldUpdateID, 
OzoneKeyDetails existingKey, ReplicationConfig replicationConfig)
   ```



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