lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r819891 - /lucene/solr/trunk/src/java/org/apache/solr/update/SolrIndexWriter.java
Date Tue, 29 Sep 2009 12:01:06 GMT
Author: shalin
Date: Tue Sep 29 12:01:05 2009
New Revision: 819891

URL: http://svn.apache.org/viewvc?rev=819891&view=rev
Log:
SOLR-1470 -- useCompoundFile was not taking effect

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/update/SolrIndexWriter.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/update/SolrIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/update/SolrIndexWriter.java?rev=819891&r1=819890&r2=819891&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/update/SolrIndexWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/update/SolrIndexWriter.java Tue Sep 29 12:01:05
2009
@@ -23,7 +23,6 @@
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.DirectoryFactory;
 import org.apache.solr.core.StandardDirectoryFactory;
-import org.apache.solr.core.SolrCore;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.util.SolrPluginUtils;
 
@@ -35,7 +34,6 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
-import java.lang.reflect.InvocationTargetException;
 import java.text.DateFormat;
 import java.util.Date;
 
@@ -63,7 +61,6 @@
     // setUseCompoundFile(false);
 
     if (config != null) {
-      setUseCompoundFile(config.useCompoundFile);
       //only set maxBufferedDocs
       if (config.maxBufferedDocs != -1) {
         setMaxBufferedDocs(config.maxBufferedDocs);
@@ -86,6 +83,14 @@
       }
       if(config.mergePolicyInfo != null) SolrPluginUtils.invokeSetters(policy,config.mergePolicyInfo.initArgs);
       setMergePolicy(policy);
+
+      if (getMergePolicy() instanceof LogMergePolicy) {
+        setUseCompoundFile(config.useCompoundFile);
+      } else  {
+        log.warn("Use of compound file format cannot be configured if merge policy is not
an instance " +
+                "of LogMergePolicy. The configured policy's defaults will be used.");
+      }
+
       className = config.mergeSchedulerInfo == null ? SolrIndexConfig.DEFAULT_MERGE_SCHEDULER_CLASSNAME:
config.mergeSchedulerInfo.className;
       MergeScheduler scheduler = (MergeScheduler) schema.getResourceLoader().newInstance(className);
       if(config.mergeSchedulerInfo != null) SolrPluginUtils.invokeSetters(scheduler,config.mergeSchedulerInfo.initArgs);



Mime
View raw message