lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [45/50] [abbrv] lucene-solr:jira/solr-11990: LUCENE-8420: Fix soft-deletes optimization.
Date Sat, 28 Jul 2018 04:50:08 GMT
LUCENE-8420: Fix soft-deletes optimization.


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

Branch: refs/heads/jira/solr-11990
Commit: 5f539442a98c70cbe4b8875a575109d05d2a3532
Parents: 914e264
Author: Adrien Grand <jpountz@gmail.com>
Authored: Fri Jul 27 11:08:19 2018 +0200
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Fri Jul 27 11:11:28 2018 +0200

----------------------------------------------------------------------
 .../index/SoftDeletesDirectoryReaderWrapper.java |  2 +-
 .../index/SoftDeletesRetentionMergePolicy.java   | 19 +------------------
 2 files changed, 2 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5f539442/lucene/core/src/java/org/apache/lucene/index/SoftDeletesDirectoryReaderWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SoftDeletesDirectoryReaderWrapper.java
b/lucene/core/src/java/org/apache/lucene/index/SoftDeletesDirectoryReaderWrapper.java
index dc35011..cf3e437 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SoftDeletesDirectoryReaderWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SoftDeletesDirectoryReaderWrapper.java
@@ -109,7 +109,7 @@ public final class SoftDeletesDirectoryReaderWrapper extends FilterDirectoryRead
       Bits liveDocs = reader.getLiveDocs();
       final FixedBitSet bits;
       if (liveDocs != null) {
-        bits = SoftDeletesRetentionMergePolicy.cloneLiveDocs(liveDocs);
+        bits = FixedBitSet.copyOf(liveDocs);
       } else {
         bits = new FixedBitSet(reader.maxDoc());
         bits.set(0, reader.maxDoc());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5f539442/lucene/core/src/java/org/apache/lucene/index/SoftDeletesRetentionMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SoftDeletesRetentionMergePolicy.java
b/lucene/core/src/java/org/apache/lucene/index/SoftDeletesRetentionMergePolicy.java
index b6f9a57..a309b7a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SoftDeletesRetentionMergePolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SoftDeletesRetentionMergePolicy.java
@@ -105,7 +105,7 @@ public final class SoftDeletesRetentionMergePolicy extends OneMergeWrappingMerge
     builder.add(retentionQuery, BooleanClause.Occur.FILTER);
     Scorer scorer = getScorer(builder.build(), wrappedReader);
     if (scorer != null) {
-      FixedBitSet cloneLiveDocs = cloneLiveDocs(liveDocs);
+      FixedBitSet cloneLiveDocs = FixedBitSet.copyOf(liveDocs);
       DocIdSetIterator iterator = scorer.iterator();
       int numExtraLiveDocs = 0;
       while (iterator.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
@@ -121,23 +121,6 @@ public final class SoftDeletesRetentionMergePolicy extends OneMergeWrappingMerge
     }
   }
 
-  /**
-   * Clones the given live docs
-   */
-  static FixedBitSet cloneLiveDocs(Bits liveDocs) {
-    if (liveDocs instanceof FixedBitSet) {
-      return ((FixedBitSet) liveDocs).clone();
-    } else { // mainly if we have asserting codec
-      FixedBitSet mutableBits = new FixedBitSet(liveDocs.length());
-      for (int i = 0; i < liveDocs.length(); i++) {
-        if (liveDocs.get(i)) {
-          mutableBits.set(i);
-        }
-      }
-      return mutableBits;
-    }
-  }
-
   private static Scorer getScorer(Query query, CodecReader reader) throws IOException {
     IndexSearcher s = new IndexSearcher(reader);
     s.setQueryCache(null);


Mime
View raw message