lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r786545 - in /lucene/java/trunk/src/java/org/apache/lucene/index: IndexWriter.java MergePolicy.java SegmentReader.java
Date Fri, 19 Jun 2009 15:30:05 GMT
Author: mikemccand
Date: Fri Jun 19 15:30:05 2009
New Revision: 786545

URL: http://svn.apache.org/viewvc?rev=786545&view=rev
Log:
LUCENE-1639: fix case where doc stores are incorrectly double opened, thus leaving open file
handles after IndexWriter is closed

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.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=786545&r1=786544&r2=786545&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 Fri Jun 19 15:30:05
2009
@@ -4829,7 +4829,7 @@
         }
 
         for(int i=0;i<numSegments;i++) {
-          merge.readersClone[i].openDocStores();
+          merge.readersClone[i].openDocStores(merge.readers[i]);
         }
 
         // Clear DSS

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java?rev=786545&r1=786544&r2=786545&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java Fri Jun 19 15:30:05
2009
@@ -133,6 +133,9 @@
         b.append(" into ").append(info.name);
       if (optimize)
         b.append(" [optimize]");
+      if (mergeDocStores) {
+        b.append(" [mergeDocStores]");
+      }
       return b.toString();
     }
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=786545&r1=786544&r2=786545&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Fri Jun 19 15:30:05
2009
@@ -475,6 +475,17 @@
     return instance;
   }
 
+  synchronized void openDocStores(SegmentReader orig) throws IOException {
+    if (fieldsReaderOrig == null) {
+      orig.openDocStores();
+      
+      fieldsReaderOrig = orig.fieldsReaderOrig;
+      termVectorsReaderOrig = orig.termVectorsReaderOrig;
+      storeCFSReader = orig.storeCFSReader;
+      cfsReader = orig.cfsReader;
+    }
+  }
+
   synchronized void openDocStores() throws IOException {
     if (fieldsReaderOrig == null) {
       final Directory storeDir;



Mime
View raw message