You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by so...@apache.org on 2020/06/26 16:10:23 UTC

[lucene-solr] branch jira/lucene-8962 updated: wordsmithing javadoc

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

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


The following commit(s) were added to refs/heads/jira/lucene-8962 by this push:
     new 77152e3  wordsmithing javadoc
77152e3 is described below

commit 77152e3c38c05f3c960978f491d0677aa2ccb099
Author: Michael Sokolov <so...@amazon.com>
AuthorDate: Fri Jun 26 12:09:43 2020 -0400

    wordsmithing javadoc
---
 .../src/java/org/apache/lucene/index/IndexWriter.java     | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index 78459ce..5544d28 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -3304,13 +3304,14 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable,
   }
 
   /**
-   * This is a sneaky optimization to allow a commit to wait for merges on smallish segments to reduce the amount of
-   * tiny segments in the commit point. What we do here is, we wrap a OneMerge to update the committingSegmentInfos
-   * one the merge has finished. We replace the source segments in the SIS that we are going to commit with the freshly
-   * merged segment but ignore all updates that are made to the merged segment after it was written. The updates that
-   * are made done belong into the commit point and should therefore not be included. See the clone call in onMergeCommit below.
-   * We also ensure that we pull the merge readers while we hold the IW lock otherwise we'd see updates being applied that
-   * don't belong into the segmetn either if it happens during the merge process.
+   * This is a sneaky optimization to allow a commit to wait for merges on smallish segments to
+   * reduce the amount of tiny segments in the commit point. What we do here is wrap a OneMerge to
+   * update the committingSegmentInfos once the merge has finished. We replace the source segments
+   * in the SIS that we are going to commit with the freshly merged segment but ignore all updates
+   * that are made to the merged segment after it was written. The updates that are made belong to
+   * the commit point and should therefore not be included. See the clone call in onMergeCommit
+   * below.  We also ensure that we pull the merge readers while holding the IW lock otherwise
+   * during the merge process we see updates being applied that don't belong to the segment.
    */
   private MergePolicy.MergeSpecification prepareOnCommitMerge(SegmentInfos committingSegmentInfos, AtomicBoolean includeInCommit) throws IOException {
     assert Thread.holdsLock(this);