hemantk-12 commented on code in PR #5454:
URL: https://github.com/apache/ozone/pull/5454#discussion_r1364297250
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -473,24 +474,24 @@ public static DBCheckpoint createOmSnapshotCheckpoint(
* @param bucketName bucket name
*/
private static void deleteKeysFromDelDirTableInSnapshotScope(
- OMMetadataManager omMetadataManager,
- String volumeName,
+ OMMetadataManager omMetadataManager, String volumeName,
String bucketName) throws IOException {
// Range delete start key (inclusive)
final String beginKey = getOzonePathKeyWithVolumeBucketNames(
omMetadataManager, volumeName, bucketName);
- // Range delete end key (exclusive). To be calculated
- String endKey;
try (TableIterator<String, ? extends Table.KeyValue<String, OmKeyInfo>>
- iter = omMetadataManager.getDeletedDirTable().iterator()) {
- endKey = findEndKeyGivenPrefix(iter, beginKey);
+ iter = omMetadataManager.getDeletedDirTable().iterator(beginKey)) {
+ performOperationGivenPrefix(iter, beginKey,
+ entry -> {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Removing key {} from DeletedDirTable",
entry.getKey());
+ }
+ omMetadataManager.getDeletedDirTable().delete(entry.getKey());
+ return null;
+ });
}
-
- // Clean up deletedDirectoryTable
- deleteRangeInclusive(omMetadataManager.getDeletedDirTable(),
Review Comment:
Please add a comment to not remove it. Someone might just go over and remove
it since it is not used anywhere.
--
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]