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


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene102/Lucene102BinaryQuantizedVectorsReader.java:
##########
@@ -257,6 +257,15 @@ public long ramBytesUsed() {
     return size;
   }
 
+  @Override
+  public long offHeapBytes() {
+    long bytes = 0L;
+    for (var field : fields.values()) {
+      bytes += field.vectorDataLength();
+    }
+    return bytes;
+  }
+

Review Comment:
   So, the user needs to know "when to sum them" and when "not to sum them" 
without any information as to what the child resources actually provide? 
   
   I guess they can do an `instanceof` and determine what they want to do per 
codec name :(
   
   seems brittle. I am not sure of a better way.



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