benwtrent commented on code in PR #13449: URL: https://github.com/apache/lucene/pull/13449#discussion_r1628362719
########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java: ########## @@ -1749,4 +1781,88 @@ long getLongValue(long index) throws IOException { return mul * values.get(index & mask) + delta; } } + + @Override + public DocValuesSkipper getSkipper(FieldInfo field) throws IOException { + final DocValuesSkipperEntry entry = skippers.get(field.name); + + final IndexInput input = data.slice("doc value skipper", entry.offset, entry.length); + // Prefetch the first page of data. Following pages are expected to get prefetched through + // read-ahead. + if (input.length() > 0) { + input.prefetch(0, 1); + } + return new DocValuesSkipper() { + int minDocID = -1; + int maxDocID = -1; + long minValue, maxValue; + int docCount; + + @Override + public void advance(int target) throws IOException { + if (target > entry.maxDocId) { + minDocID = DocIdSetIterator.NO_MORE_DOCS; + maxDocID = DocIdSetIterator.NO_MORE_DOCS; + } else { + while (true) { + maxDocID = input.readInt(); + if (maxDocID >= target) { + minDocID = input.readInt(); + maxValue = input.readLong(); + minValue = input.readLong(); + docCount = input.readInt(); + break; + } else { + input.skipBytes(24); Review Comment: Ah, I was wondering why we didn't use `vint` for the values, but now I see we keep track of the block size. Could you make this a constant? ########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java: ########## @@ -197,6 +215,17 @@ private NumericEntry readNumeric(IndexInput meta) throws IOException { return entry; } + private DocValuesSkipperEntry readDocValueSkipperMeta(IndexInput meta) throws IOException { + long offset = meta.readLong(); + long length = meta.readLong(); + long minValue = meta.readLong(); + long maxValue = meta.readLong(); + int docCount = meta.readInt(); + int maxDocID = meta.readInt(); + + return new DocValuesSkipperEntry(offset, length, minValue, maxValue, docCount, maxDocID); Review Comment: Could we validate the skipper entry? My understanding is that `length == 24*docCount` right? -- 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