hemantk-12 commented on code in PR #7556:
URL: https://github.com/apache/ozone/pull/7556#discussion_r1880562186


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDiffUtils.java:
##########
@@ -101,8 +101,11 @@ public static boolean doesSstFileContainKeyRange(String 
filepath,
             ManagedSstFileReaderIterator iterator = 
ManagedSstFileReaderIterator.managed(
                 sstFileReader.newIterator(readOptions))) {
           iterator.get().seek(prefix.getBytes(UTF_8));
-          String seekResultKey = new String(iterator.get().key(), UTF_8);
-          return seekResultKey.startsWith(prefix);
+          if (iterator.get().isValid()) {

Review Comment:
   Let's check the prefix against the first and last keys using 
[isKeyWithPrefixPresent](https://github.com/apache/ozone/blob/master/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDiffUtils.java#L49)
 e.g. firstKey <= prefix <= lastKey.



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