szetszwo commented on code in PR #4660:
URL: https://github.com/apache/ozone/pull/4660#discussion_r1188875233
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/S3MultipartUploadAbortResponse.java:
##########
@@ -97,19 +97,20 @@ public void addToDBBatch(OMMetadataManager
omMetadataManager,
OmKeyInfo currentKeyPartInfo =
OmKeyInfo.getFromProtobuf(partKeyInfo.getPartKeyInfo());
- RepeatedOmKeyInfo repeatedOmKeyInfo =
- omMetadataManager.getDeletedTable().get(partKeyInfo.getPartName());
-
- repeatedOmKeyInfo = OmUtils.prepareKeyForDelete(currentKeyPartInfo,
- repeatedOmKeyInfo, omMultipartKeyInfo.getUpdateID(), isRatisEnabled);
+ RepeatedOmKeyInfo repeatedOmKeyInfo = OmUtils.prepareKeyForDelete(
+ currentKeyPartInfo, null, omMultipartKeyInfo.getUpdateID(),
+ isRatisEnabled);
Review Comment:
After this, the `repeatedOmKeyInfo` parameter of `prepareKeyForDelete(..)`
is always null. Let's remove it.
```java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
@@ -446,8 +446,8 @@ public static File createOMDir(String dirPath) {
* create a new instance to include this key, else we update the existing
* repeatedOmKeyInfo instance.
* 3. Set the updateID to the transactionLogIndex.
* @param keyInfo args supplied by client
- * @param repeatedOmKeyInfo key details from deletedTable
* @param trxnLogIndex For Multipart keys, this is the transactionLogIndex
* of the MultipartUploadAbort request which needs to
* be set as the updateID of the partKeyInfos.
@@ -456,8 +456,7 @@ public static File createOMDir(String dirPath) {
* @return {@link RepeatedOmKeyInfo}
*/
public static RepeatedOmKeyInfo prepareKeyForDelete(OmKeyInfo keyInfo,
- RepeatedOmKeyInfo repeatedOmKeyInfo, long trxnLogIndex,
- boolean isRatisEnabled) {
+ long trxnLogIndex, boolean isRatisEnabled) {
// If this key is in a GDPR enforced bucket, then before moving
// KeyInfo to deletedTable, remove the GDPR related metadata and
// FileEncryptionInfo from KeyInfo.
@@ -473,15 +472,7 @@ public static RepeatedOmKeyInfo
prepareKeyForDelete(OmKeyInfo keyInfo,
// Set the updateID
keyInfo.setUpdateID(trxnLogIndex, isRatisEnabled);
- if (repeatedOmKeyInfo == null) {
- //The key doesn't exist in deletedTable, so create a new instance.
- repeatedOmKeyInfo = new RepeatedOmKeyInfo(keyInfo);
- } else {
- //The key exists in deletedTable, so update existing instance.
- repeatedOmKeyInfo.addOmKeyInfo(keyInfo);
- }
-
- return repeatedOmKeyInfo;
+ return new RepeatedOmKeyInfo(keyInfo);
}
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/S3MultipartUploadAbortResponse.java:
##########
@@ -97,19 +97,20 @@ public void addToDBBatch(OMMetadataManager
omMetadataManager,
OmKeyInfo currentKeyPartInfo =
OmKeyInfo.getFromProtobuf(partKeyInfo.getPartKeyInfo());
- RepeatedOmKeyInfo repeatedOmKeyInfo =
- omMetadataManager.getDeletedTable().get(partKeyInfo.getPartName());
-
- repeatedOmKeyInfo = OmUtils.prepareKeyForDelete(currentKeyPartInfo,
- repeatedOmKeyInfo, omMultipartKeyInfo.getUpdateID(), isRatisEnabled);
+ RepeatedOmKeyInfo repeatedOmKeyInfo = OmUtils.prepareKeyForDelete(
+ currentKeyPartInfo, null, omMultipartKeyInfo.getUpdateID(),
+ isRatisEnabled);
+ // multi-part key format is volumeName/bucketName/keyName/uploadId
+ String deleteKey = omMetadataManager.getOzoneDeletePathKey(
+ currentKeyPartInfo.getObjectID(), multipartKey);
Review Comment:
It should have `partNumber`/`partName`. Object id is the same for all parts.
BTW, let's add a utility method to create multipart delete key.
--
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]