lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r543071 - /lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
Date Thu, 31 May 2007 07:20:15 GMT
Author: buschmi
Date: Thu May 31 00:20:14 2007
New Revision: 543071

URL: http://svn.apache.org/viewvc?view=rev&rev=543071
Log:
Add protected convenience method for LUCENE-887. It neither changes IndexWriter's behavior,
nor is this a public API change.

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?view=diff&rev=543071&r1=543070&r2=543071
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Thu May 31 00:20:14
2007
@@ -1705,12 +1705,19 @@
 
   /** Expert:  Flushes all RAM-resident segments (buffered documents), then may merge segments.
*/
   private final synchronized void flushRamSegments() throws CorruptIndexException, IOException
{
+    flushRamSegments(true);
+  }
+    
+  /** Expert:  Flushes all RAM-resident segments (buffered documents), 
+   *           then may merge segments if triggerMerge==true. */
+  protected final synchronized void flushRamSegments(boolean triggerMerge) 
+      throws CorruptIndexException, IOException {
     if (ramSegmentInfos.size() > 0 || bufferedDeleteTerms.size() > 0) {
       mergeSegments(ramSegmentInfos, 0, ramSegmentInfos.size());
-      maybeMergeSegments(minMergeDocs);
+      if (triggerMerge) maybeMergeSegments(minMergeDocs);
     }
   }
-
+  
   /**
    * Flush all in-memory buffered updates (adds and deletes)
    * to the Directory. 



Mime
View raw message