lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r783748 - in /lucene/java/trunk/src: java/org/apache/lucene/index/IndexWriter.java test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
Date Thu, 11 Jun 2009 12:52:13 GMT
Author: mikemccand
Date: Thu Jun 11 12:52:13 2009
New Revision: 783748

URL: http://svn.apache.org/viewvc?rev=783748&view=rev
Log:
LUCNEE-1642: respect destination IW's CFS when copying tail segments in addIndexesNoOptimize

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.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?rev=783748&r1=783747&r2=783748&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Thu Jun 11 12:52:13
2009
@@ -3583,7 +3583,7 @@
           info = segmentInfos.info(i);
           if (info.dir != directory) {
             done = false;
-            final MergePolicy.OneMerge newMerge = new MergePolicy.OneMerge(segmentInfos.range(i,
1+i), info.getUseCompoundFile());
+            final MergePolicy.OneMerge newMerge = new MergePolicy.OneMerge(segmentInfos.range(i,
1+i), mergePolicy instanceof LogMergePolicy && getUseCompoundFile());
 
             // Returns true if no running merge conflicts
             // with this one (and, records this merge as

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java?rev=783748&r1=783747&r2=783748&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java Thu Jun
11 12:52:13 2009
@@ -537,4 +537,21 @@
     dir.close();
     dir2.close();
   }
+
+  // LUCENE-1642: make sure CFS of destination indexwriter
+  // is respected when copying tail segments
+  public void testTargetCFS() throws IOException {
+    Directory dir = new RAMDirectory();
+    IndexWriter writer = newWriter(dir, true);
+    writer.setUseCompoundFile(false);
+    addDocs(writer, 1);
+    writer.close();
+
+    Directory other = new RAMDirectory();
+    writer = newWriter(other, true);
+    writer.setUseCompoundFile(true);
+    writer.addIndexesNoOptimize(new Directory[] {dir});
+    assertTrue(writer.newestSegment().getUseCompoundFile());
+    writer.close();
+  }
 }



Mime
View raw message