navneet1v commented on code in PR #16705:
URL: https://github.com/apache/lucene/pull/16705#discussion_r4130213292


##########
lucene/core/src/java/org/apache/lucene/index/KnnVectorValues.java:
##########
@@ -50,12 +50,47 @@ public int ordToDoc(int ord) {
   }
 
   /**
-   * Prefetches the provided ordinals
+   * Prefetches {@code count} consecutive vectors starting at the given 
ordinal, so that later calls
+   * to read them are more likely to hit memory. Implementations should start 
the reads and return
+   * without waiting for them, and are free to prefetch fewer vectors than 
asked for, including none
+   * at all. {@code count} is clamped to the number of vectors remaining after 
{@code ord}. The
+   * default implementation is a no-op.
+   *
+   * @param ord the ordinal of the first vector to prefetch
+   * @param count how many consecutive vectors to prefetch, starting at {@code 
ord}
+   * @return the number of vectors a prefetch was actually issued for, {@code 
0} if none, in which
+   *     case the caller gains nothing by deferring the reads
+   */
+  public int prefetch(int ord, int count) throws IOException {
+    return 0;
+  }

Review Comment:
   @jimczi I think the point that we can extend the current interface to become 
use as an array implementation make sense. 



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