lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r924064 - in /lucene/solr/branches/solr: ./ lib/ src/common/org/apache/solr/common/ src/java/org/apache/solr/core/ src/maven/ src/solrj/org/ src/test/org/apache/solr/client/ src/webapp/src/org/apache/solr/client/solrj/embedded/
Date Tue, 16 Mar 2010 23:59:42 GMT
Author: yonik
Date: Tue Mar 16 23:59:42 2010
New Revision: 924064

URL: http://svn.apache.org/viewvc?rev=924064&view=rev
Log:
merge up to 923909

Modified:
    lucene/solr/branches/solr/   (props changed)
    lucene/solr/branches/solr/lib/commons-httpclient-3.1.jar   (props changed)
    lucene/solr/branches/solr/lib/jcl-over-slf4j-1.5.5.jar   (props changed)
    lucene/solr/branches/solr/src/common/org/apache/solr/common/   (props changed)
    lucene/solr/branches/solr/src/java/org/apache/solr/core/CoreContainer.java
    lucene/solr/branches/solr/src/maven/solr-core-pom.xml.template   (props changed)
    lucene/solr/branches/solr/src/maven/solr-solrj-pom.xml.template   (props changed)
    lucene/solr/branches/solr/src/solrj/org/   (props changed)
    lucene/solr/branches/solr/src/test/org/apache/solr/client/   (props changed)
    lucene/solr/branches/solr/src/webapp/src/org/apache/solr/client/solrj/embedded/   (props
changed)

Propchange: lucene/solr/branches/solr/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -2,4 +2,4 @@
 /lucene/java/branches/lucene_2_9/solr:817269-818600,825998,829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests/solr:818601-821336
 /lucene/java/branches/lucene_3_0/solr:880793,896906
-/lucene/solr/trunk:922950-922991
+/lucene/solr/trunk:922950-923910

Propchange: lucene/solr/branches/solr/lib/commons-httpclient-3.1.jar
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/lib/commons-httpclient-3.1.jar:922950-922991
+/lucene/solr/trunk/lib/commons-httpclient-3.1.jar:922950-923910

Propchange: lucene/solr/branches/solr/lib/jcl-over-slf4j-1.5.5.jar
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/lib/jcl-over-slf4j-1.5.5.jar:922950-922991
+/lucene/solr/trunk/lib/jcl-over-slf4j-1.5.5.jar:922950-923910

Propchange: lucene/solr/branches/solr/src/common/org/apache/solr/common/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/src/common/org/apache/solr/common:922950-922991
+/lucene/solr/trunk/src/common/org/apache/solr/common:922950-923910

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/core/CoreContainer.java?rev=924064&r1=924063&r2=924064&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/core/CoreContainer.java Tue Mar 16
23:59:42 2010
@@ -69,9 +69,14 @@ public class CoreContainer 
   protected boolean shareSchema;
   protected String solrHome;
   protected String solrConfigFilenameOverride;
-
   private String defaultCoreName = "";
-
+  
+  // assigned by Initializer
+  private boolean defaultAbortOnConfigError = false;
+  // number of cores that either explicitly, or because of
+  // default, said to abort on config error
+  private int numCoresAbortOnConfigError = 0;
+  
   public CoreContainer() {
     solrHome = SolrResourceLoader.locateSolrHome();
   }
@@ -83,12 +88,18 @@ public class CoreContainer 
   // Helper class to initialize the CoreContainer
   public static class Initializer {
     protected String solrConfigFilename = null;
+    // default to true for legacy behavior
     protected boolean abortOnConfigurationError = true;
 
     public boolean isAbortOnConfigurationError() {
       return abortOnConfigurationError;
     }
-
+    
+    /** Note for no good reason what so ever, this method has only ever
+     * influenced the default behavior of "single core" mode.  when using
+     * solr.xml values specified this way are ignored, and false is the default.
+     * initialize() will modify this value.
+     */
     public void setAbortOnConfigurationError(boolean abortOnConfigurationError) {
       this.abortOnConfigurationError = abortOnConfigurationError;
     }
@@ -111,20 +122,17 @@ public class CoreContainer 
       log.info("looking for solr.xml: " + fconf.getAbsolutePath());
       cores = new CoreContainer();
       cores.solrConfigFilenameOverride = solrConfigFilename;
-      if (fconf.exists())
+      if (fconf.exists()) {
+        // default abortOnConfigurationError ignored in multicore
+        cores.defaultAbortOnConfigError = false;
         cores.load(solrHome, fconf);
-      else {
+      } else {
+        cores.defaultAbortOnConfigError = abortOnConfigurationError;
         cores.load(solrHome, new ByteArrayInputStream(DEF_SOLR_XML.getBytes()));
         cores.configFile = fconf;
       }
-      abortOnConfigurationError = false;
-      // if any core aborts on startup, then abort
-      for (SolrCore c : cores.getCores()) {
-        if (c.getSolrConfig().getBool("abortOnConfigurationError", false)) {
-          abortOnConfigurationError = true;
-          break;
-        }
-      }
+      setAbortOnConfigurationError(0 < cores.numCoresAbortOnConfigError);
+      
       solrConfigFilename = cores.getConfigFile().getName();
       
       return cores;
@@ -404,6 +412,11 @@ public class CoreContainer 
     // Initialize the solr config
     SolrResourceLoader solrLoader = new SolrResourceLoader(instanceDir, libLoader, getCoreProps(instanceDir,
dcore.getPropertiesName(),dcore.getCoreProperties()));
     SolrConfig config = new SolrConfig(solrLoader, dcore.getConfigName(), null);
+
+    if (config.getBool("abortOnConfigurationError",defaultAbortOnConfigError)) {
+      numCoresAbortOnConfigError++;
+    }
+    
     IndexSchema schema = null;
     if(indexSchemaCache != null){
       //schema sharing is enabled. so check if it already is loaded

Propchange: lucene/solr/branches/solr/src/maven/solr-core-pom.xml.template
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/src/maven/solr-core-pom.xml.template:922950-922991
+/lucene/solr/trunk/src/maven/solr-core-pom.xml.template:922950-923910

Propchange: lucene/solr/branches/solr/src/maven/solr-solrj-pom.xml.template
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/src/maven/solr-solrj-pom.xml.template:922950-922991
+/lucene/solr/trunk/src/maven/solr-solrj-pom.xml.template:922950-923910

Propchange: lucene/solr/branches/solr/src/solrj/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/src/solrj/org:922950-922991
+/lucene/solr/trunk/src/solrj/org:922950-923910

Propchange: lucene/solr/branches/solr/src/test/org/apache/solr/client/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/src/test/org/apache/solr/client:922950-922991
+/lucene/solr/trunk/src/test/org/apache/solr/client:922950-923910

Propchange: lucene/solr/branches/solr/src/webapp/src/org/apache/solr/client/solrj/embedded/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 23:59:42 2010
@@ -1 +1 @@
-/lucene/solr/trunk/src/webapp/src/org/apache/solr/client/solrj/embedded:922950-922991
+/lucene/solr/trunk/src/webapp/src/org/apache/solr/client/solrj/embedded:922950-923910



Mime
View raw message