mikemccand commented on code in PR #12631: URL: https://github.com/apache/lucene/pull/12631#discussion_r1350166040
########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/FieldReader.java: ########## @@ -99,6 +102,26 @@ public final class FieldReader extends Terms { */ } + long readVLongOutput(DataInput in) throws IOException { + if (parent.version >= VERSION_MSB_VLONG_OUTPUT) { + return readMSBVLong(in); + } else { + return in.readVLong(); + } + } + + private static long readMSBVLong(DataInput in) throws IOException { Review Comment: Could you add a private javadoc linking to the write method? E.g. `/** Decodes a variable length byte[] in MSB order back to long, as written by Lucene90BlockTreeTermsWriter.writeMSBVLong. Use FieldReader#readMSBVlong to decode. */` ########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/Lucene90BlockTreeTermsWriter.java: ########## @@ -460,6 +460,19 @@ public String toString() { return "BLOCK: prefix=" + brToString(prefix); } + private static void writeMSBVLong(long l, DataOutput scratchBytes) throws IOException { Review Comment: Could we please add a randomized test that asserts that randomly encoding & decoding (non-negative?) long values always returns the same long / does not fail? ########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/Lucene90BlockTreeTermsWriter.java: ########## @@ -460,6 +460,19 @@ public String toString() { return "BLOCK: prefix=" + brToString(prefix); } + private static void writeMSBVLong(long l, DataOutput scratchBytes) throws IOException { Review Comment: Also, could you add a comment pointing to the corresponding read method matching this write method? E.g. `/** Encodes long value to variable length byte[], in MSB order. Use FieldReader#readMSBVlong to decode. */` -- 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