shubhamvishu commented on code in PR #15982:
URL: https://github.com/apache/lucene/pull/15982#discussion_r3260876763
##########
lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene99/Lucene99ScalarQuantizedVectorsWriter.java:
##########
@@ -819,6 +822,14 @@ ScalarQuantizer createQuantizer() throws IOException {
return quantizer;
}
+ /**
+ * Returns the RAM usage of quantization-specific state only. The
underlying flat vector data is
+ * tracked separately by the rawVectorDelegate at the writer level.
+ */
+ long quantizationOverheadBytesUsed() {
+ return SHALLOW_SIZE;
+ }
+
@Override
public long ramBytesUsed() {
long size = SHALLOW_SIZE;
Review Comment:
> The FieldWriter.ramBytesUsed() method exists purely to satisfy the
Accountable interface for standalone introspection (e.g. tests, debugging), not
to feed the writer's own accounting.
Ahh this makes sense and gives me clarity now. Thanks !
So the `FieldWriter` does not track any flat vector data anymore even though
it does if asked specifically(which we should call on the main code path for
accounting). Could you add a comment above
`flatFieldVectorsWriter.ramBytesUsed()` in `FieldWriter#ramBytesUsed` to
mention this is a no-op in case of overall accounting(but solely exists for
maintaining api correctness/contract) so others are also not confused?
--
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]