You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2010/08/23 13:37:48 UTC

svn commit: r988083 - in /lucene/dev/branches/branch_3x/lucene/src: java/org/apache/lucene/index/IndexWriter.java test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java

Author: shaie
Date: Mon Aug 23 11:37:47 2010
New Revision: 988083

URL: http://svn.apache.org/viewvc?rev=988083&view=rev
Log:
LUCENE-2610: addIndexes(Directory...) should not trigger merge on flush()

Modified:
    lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java

Modified: lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/IndexWriter.java?rev=988083&r1=988082&r2=988083&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/IndexWriter.java Mon Aug 23 11:37:47 2010
@@ -2977,7 +2977,7 @@ public class IndexWriter implements Clos
     try {
       if (infoStream != null)
         message("flush at addIndexes(Directory...)");
-      flush(true, false, true);
+      flush(false, false, true);
       
       int docCount = 0;
       List<SegmentInfo> infos = new ArrayList<SegmentInfo>();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java?rev=988083&r1=988082&r2=988083&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestSnapshotDeletionPolicy.java Mon Aug 23 11:37:47 2010
@@ -329,6 +329,7 @@ public class TestSnapshotDeletionPolicy 
     writer.commit();
     writer.deleteUnusedFiles();
     assertSnapshotExists(dir, sdp, numSnapshots - 1);
+    writer.close();
     
     // but 'snapshot1' files will still exist (need to release snapshot before they can be deleted).
     String segFileName = sdp.getSnapshot("snapshot1").getSegmentsFileName();
@@ -360,6 +361,7 @@ public class TestSnapshotDeletionPolicy 
     }
     assertNull(sdp.getSnapshots().get(snapId));
     writer.deleteUnusedFiles();
+    writer.close();
     assertFalse("segments file should not be found in dirctory: " + segFileName, dir.fileExists(segFileName));
     dir.close();
   }