aswinshakil commented on code in PR #4407:
URL: https://github.com/apache/ozone/pull/4407#discussion_r1142689856
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java:
##########
@@ -281,12 +331,40 @@ private boolean checkKeyReclaimable(
return false;
}
- //TODO: [SNAPSHOT] Handle Renamed Keys
- String dbKey = ozoneManager.getMetadataManager()
- .getOzoneKey(deletedKeyInfo.getVolumeName(),
- deletedKeyInfo.getBucketName(), deletedKeyInfo.getKeyName());
+ if (bucketInfo.getBucketLayout().isFileSystemOptimized()) {
+ // Handle FSO buckets
+ dbKey = ozoneManager.getMetadataManager().getOzonePathKey(volumeId,
+ bucketInfo.getObjectID(), deletedKeyInfo.getParentObjectID(),
+ deletedKeyInfo.getKeyName());
+ } else {
+ dbKey = ozoneManager.getMetadataManager()
+ .getOzoneKey(deletedKeyInfo.getVolumeName(),
+ deletedKeyInfo.getBucketName(), deletedKeyInfo.getKeyName());
+ }
+
+ // renamedKeyTable: volumeName/bucketName/objectID -> OMRenameKeyInfo
+ String dbRenameKey = ozoneManager.getMetadataManager().getRenameKey(
+ deletedKeyInfo.getVolumeName(), deletedKeyInfo.getBucketName(),
+ deletedKeyInfo.getObjectID());
+
+ OmKeyRenameInfo renamedKeyInfo = renamedKeyTable.getIfExist(dbRenameKey);
+
+ boolean isKeyRenamed = false;
+ String dbOriginalKey = null;
+ // Condition: key should not exist in renamedKeyTable of the current
+ // snapshot and keyTable of the previous snapshot.
+ // Check key exists in renamedKeyTable of the Snapshot
+ if (renamedKeyInfo != null && !renamedKeyInfo
+ .getOmKeyRenameInfoList().isEmpty()) {
Review Comment:
Refactored the code change in #4436
--
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]