iverase commented on issue #12459: URL: https://github.com/apache/lucene/issues/12459#issuecomment-2431552556
Now that lucene 10 has been released and our java minimum version is 21, the RandomAccessInput API got efficient methods to read byte[] from the method #readBytes, I think this API makes more sense now to use that abstraction as in my opinion os the closest API to a BytesRef but not implying the the bytes are on heap. In this case the API can be as simple as something like: ``` /** * A per-document binary value. * * @lucene.experimental */ public abstract class RandomAccessInputDocValues extends DocValuesIterator { /** Sole constructor. (For invocation by subclass constructors, typically implicit.) */ protected RandomAccessInputDocValues() {} /** * Returns the binary value as a {@link RandomAccessInput} for the current document ID. The bytes * start at position 0 up to {@link RandomAccessInput#length()}. It is illegal to call this method * after {@link #advanceExact(int)} returned {@code false}. * * @return the binary value as a {@link RandomAccessInput} */ public abstract RandomAccessInput randomAccessInputValue() throws IOException; } ``` -- 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