jpountz commented on code in PR #14552: URL: https://github.com/apache/lucene/pull/14552#discussion_r2071284659
########## lucene/core/src/java/org/apache/lucene/index/SingletonSortedNumericDocValues.java: ########## @@ -57,6 +58,16 @@ public int advance(int target) throws IOException { return in.advance(target); } + @Override + public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException { + in.intoBitSet(upTo, bitSet, offset); + } + + @Override + public int docIDRunEnd() throws IOException { + return in.docIDRunEnd(); + } Review Comment: Maybe extract this change to a separate PR and cover all wrappers? ########## lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java: ########## @@ -526,6 +540,60 @@ public int nextDoc() throws IOException { } while (hasValue == false); return docIDOut; } + + @Override + public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException { + if (onDiskDocValues == null) { + super.intoBitSet(upTo, bitSet, offset); + return; + } + + // we need a scratch bitset because the param bitset doesn't allow bits to be cleared. + if (scratch == null || scratch.length() < upTo - offset) { Review Comment: Should we compare scratch.length() with bitSet.length() rather than `upTo - offset`? My concern is that there are multiple call sites that call intoBitSet with upTo=NO_MORE_DOCS, so this could create a giant bit set? ########## lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java: ########## @@ -526,6 +540,60 @@ public int nextDoc() throws IOException { } while (hasValue == false); return docIDOut; } + + @Override + public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException { + if (onDiskDocValues == null) { + super.intoBitSet(upTo, bitSet, offset); + return; + } + + // we need a scratch bitset because the param bitset doesn't allow bits to be cleared. + if (scratch == null || scratch.length() < upTo - offset) { + // intoBitSet is usually called with fixed window size so we do not do overSize here. + scratch = new FixedBitSet(upTo - offset); Review Comment: Maybe use FixedBitSet#ensureCapacity? -- 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