You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/27 08:00:20 UTC

[GitHub] [kafka] showuon commented on a change in pull request #11120: Add support for infinite endpoints for range queries

showuon commented on a change in pull request #11120:
URL: https://github.com/apache/kafka/pull/11120#discussion_r677209624



##########
File path: streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBRangeIterator.java
##########
@@ -63,6 +65,9 @@
         final KeyValue<Bytes, byte[]> next = super.makeNext();
         if (next == null) {
             return allDone();
+        } else if (rawLastKey == null) {
+            return next;

Review comment:
       We changed the meaning of `rawLastKey`, need to add some comment for `rawLastKey == null` case.

##########
File path: streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBRangeIterator.java
##########
@@ -44,17 +44,19 @@
         this.forward = forward;
         this.toInclusive = toInclusive;
         if (forward) {
-            iter.seek(from.get());
-            rawLastKey = to.get();
-            if (rawLastKey == null) {
-                throw new NullPointerException("RocksDBRangeIterator: RawLastKey is null for key " + to);
+            if (from == null) {
+                iter.seekToFirst();
+            } else {
+                iter.seek(from.get());
             }
+            rawLastKey = to == null ? null : to.get();

Review comment:
       Should we still need to have `rawLastKey` null check for the `to.get()` case? 
   
   Same comments to the other similar places.




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org