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



##########
File path: 
lucene/core/src/java/org/apache/lucene/util/packed/MonotonicBlockPackedReader.java
##########
@@ -72,24 +75,44 @@ private MonotonicBlockPackedReader(
         throw new IOException("Corrupted");
       }
       if (bitsPerValue == 0) {
-        subReaders[i] = new PackedInts.NullReader(blockSize);
+        subReaders[i] = LongValues.ZEROES;
       } else {
         final int size = (int) Math.min(blockSize, valueCount - (long) i * 
blockSize);
-        if (direct) {
-          final long pointer = in.getFilePointer();
-          subReaders[i] =
-              PackedInts.getDirectReaderNoHeader(
-                  in, PackedInts.Format.PACKED, packedIntsVersion, size, 
bitsPerValue);
-          in.seek(
-              pointer + PackedInts.Format.PACKED.byteCount(packedIntsVersion, 
size, bitsPerValue));
-        } else {
-          subReaders[i] =
-              PackedInts.getReaderNoHeader(
-                  in, PackedInts.Format.PACKED, packedIntsVersion, size, 
bitsPerValue);
-        }
+        blocksSize += size;

Review comment:
       you seem to be using blocksSize to indicate RAM usage, ie. number of 
bytes in memory, but `size` is actually a number of values? should we add 
byteCount rather?




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