You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/04/15 13:16:02 UTC

[GitHub] [lucene] jpountz commented on a change in pull request #72: LUCENE-9907: Remove packedInts#getReaderNoHeader dependency on TermsVectorFieldsFormat

jpountz commented on a change in pull request #72:
URL: https://github.com/apache/lucene/pull/72#discussion_r614052826



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingTermVectorsReader.java
##########
@@ -295,6 +300,38 @@ public TermVectorsReader clone() {
     return new Lucene90CompressingTermVectorsReader(this);
   }
 
+  private static RandomAccessInput slice(IndexInput in) throws IOException {
+    final int length = in.readVInt();
+    final byte[] bytes = new byte[length];
+    in.readBytes(bytes, 0, length);
+    final ByteArrayDataInput input = new ByteArrayDataInput(bytes);

Review comment:
       it'd probably be easier by getting a ByteBuffer wrapper than a ByteArrayDataInput, since ByteBuffer already has logic to have random access to bytes, shorts, ints and longs

##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingTermVectorsWriter.java
##########
@@ -223,6 +224,7 @@ void addPosition(int position, int startOffset, int length, int payloadLength) {
   private final ByteBuffersDataOutput payloadBytes; // buffered term payloads
   private final BlockPackedWriter writer;
   private final int maxDocsPerChunk; // hard limit on number of docs per chunk
+  private final ByteBuffersDataOutput scratchBuffer = ByteBuffersDataOutput.newResettableInstance();

Review comment:
       can you add it to `ramBytesUsed()`?




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

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



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