aryangupta1998 commented on code in PR #9423:
URL: https://github.com/apache/ozone/pull/9423#discussion_r2620689663
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/DeleteKeysResult.java:
##########
@@ -27,12 +30,35 @@
public class DeleteKeysResult {
private List<OmKeyInfo> keysToDelete;
-
private boolean processedKeys;
+ private List<ExclusiveRange> keyRanges;
+ private static final Logger LOG =
LoggerFactory.getLogger(DeleteKeysResult.class);
- public DeleteKeysResult(List<OmKeyInfo> keysToDelete, boolean processedKeys)
{
+ public DeleteKeysResult(List<OmKeyInfo> keysToDelete, List<ExclusiveRange>
keyRanges, boolean processedKeys) {
this.keysToDelete = keysToDelete;
this.processedKeys = processedKeys;
+ this.keyRanges = keyRanges;
+ validateNonOverlappingRanges();
+ }
+
+ private void validateNonOverlappingRanges() {
Review Comment:
@ashishkumar50,
In Ozone, RocksDB uses the default bytewise comparator, which compares keys
by their raw byte sequence, so string keys are stored and returned in
lexicographically sorted order. That means the ranges we construct from the
iterator are already ordered. Also, the `deleteRangeWithBatch()` API treats the
end key as exclusive, so even in the corner case where `endKey =
getLexicographicallyHigherString(path)` for one range and the next iterator
entry yields `startKey = getLexicographicallyHigherString(path)`, the ranges do
not overlap `([start, end) then [end, …))`, which is safe. Based on this, I
removed `validateNonOverlappingRanges()`, as RocksDB’s ordering plus our range
construction logic already guarantees non‑overlapping, sorted ranges.
--
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]