mike-tr-adamson commented on code in PR #2943:
URL: https://github.com/apache/cassandra/pull/2943#discussion_r1410884829


##########
src/java/org/apache/cassandra/index/sai/disk/v1/keystore/KeyLookup.java:
##########
@@ -265,42 +258,39 @@ public void reset() throws IOException
             readCurrentKey();
         }
 
-
         @Override
         public void close()
         {
             keysInput.close();
         }
 
-        private void updateCurrentBlockIndex(long pointId)
+        private int keyInBlockComparison(long pointId, BytesRef key)
         {
-            currentBlockIndex = pointId >>> blockShift;
-        }
+            updateCurrentBlockIndex(pointId);
+            resetToCurrentBlock();
+            if (compareKeys(key, currentKey) < 0)
+                return -1;
 
-        private boolean notInCurrentBlock(long pointId, BytesRef key)
-        {
-            if (inLastBlock(pointId))
-                return false;
+            if (currentBlockIndex == blockOffsets.length() -1)
+                return 0;

Review Comment:
   I have added a comment to this line to try to clarify it. This is really a 
deferal of decision making to later because we don't have any further blocks to 
look at if we are in the last block.



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