szetszwo commented on PR #9553:
URL: https://github.com/apache/ozone/pull/9553#issuecomment-3865790998

   > ... because we reverted https://github.com/apache/ozone/pull/8774 ...
   
   The revert only requires supporting  deleteRangeWithBatch in a loop, i.e. 
pure batch deleteRange.  No?
   ```diff
   commit 90f62ad63b99b1534f73a8c5790157ed40619ee0
   Author: Swaminathan Balachandran <[email protected]>
   Date:   Thu Dec 25 00:20:57 2025 -0500
   
       HDDS-14240. Revert HDDS-13415 to separate out Refactoring and 
implementation of Delete Range with batch (#9554)
   
   +++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
   @@ -92,6 +92,7 @@
    import org.apache.hadoop.hdds.utils.db.RocksDBCheckpoint;
    import org.apache.hadoop.hdds.utils.db.RocksDatabase;
    import org.apache.hadoop.hdds.utils.db.Table;
   +import org.apache.hadoop.hdds.utils.db.TableIterator;
    import org.apache.hadoop.hdds.utils.db.managed.ManagedColumnFamilyOptions;
    import org.apache.hadoop.hdds.utils.db.managed.ManagedDBOptions;
    import org.apache.hadoop.hdds.utils.db.managed.ManagedRocksDB;
   @@ -583,7 +584,11 @@ private static void 
deleteKeysFromTableWithBucketPrefix(OMMetadataManager metada
        String endKey = getLexicographicallyHigherString(prefix);
        LOG.debug("Deleting key range from {} - startKey: {}, endKey: {}",
            table.getName(), prefix, endKey);
   -    table.deleteRangeWithBatch(batchOperation, prefix, endKey);
   +    try (TableIterator<String, String> itr = table.keyIterator(prefix)) {
   +      while (itr.hasNext()) {
   +        table.deleteWithBatch(batchOperation, itr.next());
   +      }
   +    }
      }
   ```


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