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:41:08 UTC

[lucene-solr] branch branch_8x 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 branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


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

commit e84efa9a5e3284696019722d5dba51c2c4b8f3cb
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                                                 | 7 +++++++
 .../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, 11 insertions(+), 4 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9c0a5b1..a788fc1 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -28,6 +28,13 @@ API Changes
   provide them lazily.  TermsInSetQuery switches to using this method
   to report matching terms. (Alan Woodward)
 
+* LUCENE-9366: DocValues.emptySortedNumeric() no 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)
+
 New Features
 ---------------------
 (No changes)
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;
       }