benwtrent commented on code in PR #13200:
URL: https://github.com/apache/lucene/pull/13200#discussion_r1548282620


##########
lucene/core/src/java/org/apache/lucene/codecs/ByteVectorProvider.java:
##########
@@ -33,6 +34,29 @@ public interface ByteVectorProvider {
    */
   int dimension();
 
+  /**
+   * Returns the byte offset of the byte vector value for the given target 
ordinal.
+   *
+   * @param targetOrd the ordinal of the target vector
+   * @return the byte offset of the byte vector value, or -1 if the offset 
isn't available.
+   */
+  default long vectorByteOffset(int targetOrd) throws IOException {
+    return -1;
+  }
+
+  /** Returns the byte length of the byte vector value. */
+  default int vectorElementByteSize() {
+    return dimension();
+  }
+
+  /**
+   * Returns the {@link IndexInput} for the byte vector data or null if the 
data is not stored in a
+   * file.
+   */
+  default IndexInput vectorData() throws IOException {

Review Comment:
   I am unsure about this actually, I just reverted it. Maybe I can add it 
back. I am hesitent a little bit as it seems like this could be leaking a bit 
of the codec. For example, there would be non-trivial knowledge required to 
handle an off-heap `int4` or binary calculation, or anything that stores the 
vectors in any format other than flat bytes. 
   
   It seems to me that the codec itself should provide optimized vector 
similarities for known similarities.
   
   Requiring something like users to provide 
`int4CompressedOptimizedDotProduct` to get the best experience there when the 
codec should "just do it" seems weird.



-- 
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: issues-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to