Savonitar commented on code in PR #30190:
URL: https://github.com/apache/flink/pull/30190#discussion_r4768988904


##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/state/rocksdb/RocksDBOperationUtils.java:
##########
@@ -182,14 +201,25 @@ static RocksIteratorWrapper 
getRocksIteratorBoundedByPrefix(
     @Nullable
     @VisibleForTesting
     static byte[] getPrefixEnd(byte[] prefix) {
-        for (int i = prefix.length - 1; i >= 0; --i) {
-            if (prefix[i] != (byte) 0xFF) {
-                final byte[] prefixEnd = Arrays.copyOf(prefix, i + 1);
-                ++prefixEnd[i];
-                return prefixEnd;
-            }

Review Comment:
   There was already a direct parameterized test for getPrefixEnd() in 
[RocksDBPrefixIteratorTest](https://github.com/apache/flink/blob/6ac422f2e8e82139fcae737cf8e2d1c1b15cabb1/flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/state/rocksdb/RocksDBPrefixIteratorTest.java#L51-L55)
 . 
   But I clarified the Javadoc and added three cases to that test so it now 
covers every example in the documentation.



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

Reply via email to