You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2018/09/05 14:38:09 UTC

[2/2] lucene-solr:branch_7x: LUCENE-8484: Only drop fully deleted segments in SoftDeletesDirectoryReaderWrapper

LUCENE-8484: Only drop fully deleted segments in SoftDeletesDirectoryReaderWrapper

This specializes the change in LUCENE-8484 since there are valid usecases
where filtered reader should not modify the number of readers if a higher
level reader wants to expose the deleted or soft-deleted docs.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ae5adf63
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ae5adf63
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ae5adf63

Branch: refs/heads/branch_7x
Commit: ae5adf6307bd79cca40ce23083e5d741cf4d6022
Parents: 3340068
Author: Simon Willnauer <si...@apache.org>
Authored: Wed Sep 5 15:26:37 2018 +0200
Committer: Simon Willnauer <si...@apache.org>
Committed: Wed Sep 5 16:37:47 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/lucene/index/FilterDirectoryReader.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ae5adf63/lucene/core/src/java/org/apache/lucene/index/FilterDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/FilterDirectoryReader.java
index d9ddb94..4a9cd68 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FilterDirectoryReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FilterDirectoryReader.java
@@ -18,7 +18,6 @@ package org.apache.lucene.index;
 
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -51,6 +50,11 @@ public abstract class FilterDirectoryReader extends DirectoryReader {
    */
   public static abstract class SubReaderWrapper {
 
+    /**
+     * Wraps a list of LeafReaders
+     * @return an array of wrapped LeafReaders. The returned array might contain less elements compared to the given
+     * reader list if an entire reader is filtered out.
+     */
     protected LeafReader[] wrap(List<? extends LeafReader> readers) {
       LeafReader[] wrapped = new LeafReader[readers.size()];
       int i = 0;