SOLR-350 -- change the multicore initialization path in the DispatchFilter to use an existing MultiCore configuration if it is already configured.

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@611821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2008-01-14 14:52:25 +00:00
parent 981d977eef
commit 5bfe7bff4c
1 changed files with 11 additions and 6 deletions

View File

@ -71,15 +71,20 @@ public class SolrDispatchFilter implements Filter
// Find a valid solr core
SolrCore core = null;
multicore = MultiCore.getRegistry();
String instanceDir = SolrResourceLoader.locateInstanceDir();
File multiconfig = new File( instanceDir, "multicore.xml" );
log.info( "looking for multicore.xml: "+multiconfig.getAbsolutePath() );
if( multiconfig.exists() ) {
multicore.load( instanceDir, multiconfig );
core = multicore.getDefaultCore();
if( multicore.isEnabled() ) {
log.info( "Using existing multicore configuration" );
}
else {
String instanceDir = SolrResourceLoader.locateInstanceDir();
File multiconfig = new File( instanceDir, "multicore.xml" );
log.info( "looking for multicore.xml: "+multiconfig.getAbsolutePath() );
if( multiconfig.exists() ) {
multicore.load( instanceDir, multiconfig );
}
}
if( multicore.isEnabled() ) {
singlecore = null;
core = multicore.getDefaultCore();
}
else {
singlecore = new SolrCore( null, null, new SolrConfig(), null );