iverase commented on code in PR #14358:
URL: https://github.com/apache/lucene/pull/14358#discussion_r1997607493


##########
lucene/core/src/java/org/apache/lucene/util/packed/DirectMonotonicReader.java:
##########
@@ -90,102 +140,142 @@ public static DirectMonotonicReader getInstance(Meta 
meta, RandomAccessInput dat
 
   /** Retrieves an instance from the specified slice. */
   public static DirectMonotonicReader getInstance(
-      Meta meta, RandomAccessInput data, boolean merging) throws IOException {
-    final LongValues[] readers = new LongValues[meta.numBlocks];
-    for (int i = 0; i < meta.numBlocks; ++i) {
-      if (meta.bpvs[i] == 0) {
-        readers[i] = LongValues.ZEROES;
-      } else if (merging
-          && i < meta.numBlocks - 1 // we only know the number of values for 
the last block
-          && meta.blockShift >= DirectReader.MERGE_BUFFER_SHIFT) {
-        readers[i] =
-            DirectReader.getMergeInstance(
-                data, meta.bpvs[i], meta.offsets[i], 1L << meta.blockShift);
+      Meta meta, RandomAccessInput data, boolean merging) {
+    return meta.getInstance(data, merging);
+  }
+
+  private static final class SingleBlockMeta extends Meta {
+    private final long min;
+    private final float avg;
+    private final byte bpv;
+    private final long offset;
+
+    private SingleBlockMeta(long min, float avg, byte bpv, long offset) {
+      this.min = min;
+      this.avg = avg;
+      this.bpv = bpv;
+      this.offset = offset;

Review Comment:
   This offset seems to always be zero, is that correct? Then we can get rid of 
it. 



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

Reply via email to