mccullocht commented on code in PR #15722:
URL: https://github.com/apache/lucene/pull/15722#discussion_r2825771676


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapByteVectorValues.java:
##########
@@ -81,6 +81,19 @@ public byte[] vectorValue(int targetOrd) throws IOException {
     return binaryValue;
   }
 
+  @Override
+  public void prefetch(final int[] ordsToPrefetch, int numOrds) throws 
IOException {
+    if (ordsToPrefetch == null || numOrds <= 1) {
+      return;
+    }
+
+    // 1. calculate offset and prefetch immediately
+    for (int i = 0; i < ordsToPrefetch.length; i++) {

Review Comment:
   I don't think this implementation matches the description of the interface, 
it will attempt to prefetch beyond numOrds. Same with 
`OffHeapFloatVectorValues`.
   
   ```suggestion
       for (int i = 0; i < Math.min(ordsToPrefetch.length, numOrds); i++) {
   ```



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