You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2020/05/07 13:28:20 UTC

[lucene-solr] branch master updated: LUCENE-9366: Remove unused maxDoc parameter from DocValues.emptySortedNumeric() (#1491)

This is an automated email from the ASF dual-hosted git repository.

romseygeek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new d06294e  LUCENE-9366: Remove unused maxDoc parameter from DocValues.emptySortedNumeric() (#1491)
d06294e is described below

commit d06294e6abac140a069ddc1b60cf563f38ae797f
Author: Alan Woodward <ro...@apache.org>
AuthorDate: Thu May 7 14:28:01 2020 +0100

    LUCENE-9366: Remove unused maxDoc parameter from DocValues.emptySortedNumeric() (#1491)
---
 lucene/CHANGES.txt                                                   | 3 +++
 lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java | 2 +-
 lucene/core/src/java/org/apache/lucene/index/DocValues.java          | 4 ++--
 lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java     | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 77dce67..a35f575 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -150,6 +150,9 @@ API Changes
   provide them lazily.  TermsInSetQuery switches to using this method
   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
   CorruptIndexException if checksums mismatch or if checksums can't be verified.
   (Martin Amirault, Adrien Grand)
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java
index 408d978..c4bae5c 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java
@@ -393,7 +393,7 @@ public abstract class DocValuesConsumer implements Closeable {
                                   }
                                 }
                                 if (values == null) {
-                                  values = DocValues.emptySortedNumeric(mergeState.maxDocs[i]);
+                                  values = DocValues.emptySortedNumeric();
                                 }
                                 cost += values.cost();
                                 subs.add(new SortedNumericDocValuesSub(mergeState.docMaps[i], values));
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocValues.java b/lucene/core/src/java/org/apache/lucene/index/DocValues.java
index 63488d0..f90d715 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocValues.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocValues.java
@@ -168,7 +168,7 @@ public final class DocValues {
   /**
    * 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() {
       
       private int doc = -1;
@@ -387,7 +387,7 @@ public final class DocValues {
       NumericDocValues single = reader.getNumericDocValues(field);
       if (single == null) {
         checkField(reader, field, DocValuesType.SORTED_NUMERIC, DocValuesType.NUMERIC);
-        return emptySortedNumeric(reader.maxDoc());
+        return emptySortedNumeric();
       }
       return singleton(single);
     }
diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
index b9ee2f5..d515b6d 100644
--- a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
+++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
@@ -434,7 +434,7 @@ public class MultiDocValues {
       LeafReaderContext context = leaves.get(i);
       SortedNumericDocValues v = context.reader().getSortedNumericDocValues(field);
       if (v == null) {
-        v = DocValues.emptySortedNumeric(context.reader().maxDoc());
+        v = DocValues.emptySortedNumeric();
       } else {
         anyReal = true;
       }