LUCENE-9366: Remove unused maxDoc parameter from DocValues.emptySortedNumeric() (#1491)

This commit is contained in:
Alan Woodward 2020-05-07 14:28:01 +01:00 committed by GitHub
parent 583499243a
commit d06294e6ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -150,6 +150,9 @@ API Changes
provide them lazily. TermsInSetQuery switches to using this method provide them lazily. TermsInSetQuery switches to using this method
to report matching terms. (Alan Woodward) to report matching terms. (Alan Woodward)
* LUCENE-9366: DocValues.emptySortedNumeric() not longer takes a maxDoc parameter
(Alan Woodward)
* LUCENE-7822: CodecUtil#checkFooter(IndexInput, Throwable) now throws a * LUCENE-7822: CodecUtil#checkFooter(IndexInput, Throwable) now throws a
CorruptIndexException if checksums mismatch or if checksums can't be verified. CorruptIndexException if checksums mismatch or if checksums can't be verified.
(Martin Amirault, Adrien Grand) (Martin Amirault, Adrien Grand)

View File

@ -393,7 +393,7 @@ public abstract class DocValuesConsumer implements Closeable {
} }
} }
if (values == null) { if (values == null) {
values = DocValues.emptySortedNumeric(mergeState.maxDocs[i]); values = DocValues.emptySortedNumeric();
} }
cost += values.cost(); cost += values.cost();
subs.add(new SortedNumericDocValuesSub(mergeState.docMaps[i], values)); subs.add(new SortedNumericDocValuesSub(mergeState.docMaps[i], values));

View File

@ -168,7 +168,7 @@ public final class DocValues {
/** /**
* An empty SortedNumericDocValues which returns zero values for every document * An empty SortedNumericDocValues which returns zero values for every document
*/ */
public static final SortedNumericDocValues emptySortedNumeric(int maxDoc) { public static final SortedNumericDocValues emptySortedNumeric() {
return new SortedNumericDocValues() { return new SortedNumericDocValues() {
private int doc = -1; private int doc = -1;
@ -387,7 +387,7 @@ public final class DocValues {
NumericDocValues single = reader.getNumericDocValues(field); NumericDocValues single = reader.getNumericDocValues(field);
if (single == null) { if (single == null) {
checkField(reader, field, DocValuesType.SORTED_NUMERIC, DocValuesType.NUMERIC); checkField(reader, field, DocValuesType.SORTED_NUMERIC, DocValuesType.NUMERIC);
return emptySortedNumeric(reader.maxDoc()); return emptySortedNumeric();
} }
return singleton(single); return singleton(single);
} }

View File

@ -434,7 +434,7 @@ public class MultiDocValues {
LeafReaderContext context = leaves.get(i); LeafReaderContext context = leaves.get(i);
SortedNumericDocValues v = context.reader().getSortedNumericDocValues(field); SortedNumericDocValues v = context.reader().getSortedNumericDocValues(field);
if (v == null) { if (v == null) {
v = DocValues.emptySortedNumeric(context.reader().maxDoc()); v = DocValues.emptySortedNumeric();
} else { } else {
anyReal = true; anyReal = true;
} }