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


##########
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:
   The block size is actually 28. We read the first 4 bytes to compute the 
maxDocID and we skip the rest if it is not competitive.
   
   I am hesitant to add a constant at the moment as this might change if we 
introduce levels.



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