From 425d8ac209c57dd1a0faf639330607c861613556 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Wed, 13 Aug 2008 14:57:20 +0000 Subject: [PATCH] SOLR-695 -- refactoring MultiCore to CoreContainer git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@685577 13f79535-47bb-0310-9956-ffa450edef68 --- .../solrj/embedded/EmbeddedSolrServer.java | 10 ++-- .../solrj/MultiCoreExampleTestBase.java | 4 +- .../solrj/embedded/JettyWebappTest.java | 1 + example/solr/conf/schema.xml | 8 ++++ .../{MultiCore.java => CoreContainer.java} | 40 ++++++++-------- .../org/apache/solr/core/CoreDescriptor.java | 17 +++---- src/java/org/apache/solr/core/SolrCore.java | 4 +- ...CoreHandler.java => CoreAdminHandler.java} | 20 ++++---- .../solr/servlet/SolrDispatchFilter.java | 46 +++++++++---------- src/webapp/web/admin/index.jsp | 2 +- src/webapp/web/index.jsp | 2 +- 11 files changed, 80 insertions(+), 74 deletions(-) rename src/java/org/apache/solr/core/{MultiCore.java => CoreContainer.java} (93%) rename src/java/org/apache/solr/handler/admin/{MultiCoreHandler.java => CoreAdminHandler.java} (92%) diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java b/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java index 1528115075c..8a57e5f3e03 100644 --- a/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java +++ b/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java @@ -34,7 +34,7 @@ import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.util.NamedList; -import org.apache.solr.core.MultiCore; +import org.apache.solr.core.CoreContainer; import org.apache.solr.core.SolrCore; import org.apache.solr.request.BinaryResponseWriter; import org.apache.solr.request.QueryResponseWriter; @@ -55,9 +55,9 @@ import org.apache.solr.servlet.SolrRequestParsers; public class EmbeddedSolrServer extends SolrServer { - protected final MultiCore multicore; // either multicore + protected final CoreContainer multicore; // either multicore protected final SolrCore core; // or single core - protected final String coreName; // use MultiCore registry + protected final String coreName; // use CoreContainer registry private final SolrRequestParsers _parser; @@ -73,10 +73,10 @@ public class EmbeddedSolrServer extends SolrServer _parser = new SolrRequestParsers( null ); } - public EmbeddedSolrServer( MultiCore multicore, String coreName ) + public EmbeddedSolrServer( CoreContainer multicore, String coreName ) { if ( multicore == null ) { - throw new NullPointerException("MultiCore instance required"); + throw new NullPointerException("CoreContainer instance required"); } this.core = null; this.multicore = multicore; diff --git a/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java b/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java index 004b8e1551a..85005ac47cd 100644 --- a/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java +++ b/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java @@ -25,7 +25,7 @@ import org.apache.solr.client.solrj.request.UpdateRequest; import org.apache.solr.client.solrj.request.UpdateRequest.ACTION; import org.apache.solr.client.solrj.response.MultiCoreResponse; import org.apache.solr.common.SolrInputDocument; -import org.apache.solr.core.MultiCore; +import org.apache.solr.core.CoreContainer; /** @@ -34,7 +34,7 @@ import org.apache.solr.core.MultiCore; */ public abstract class MultiCoreExampleTestBase extends SolrExampleTestBase { - protected static final MultiCore multicore = new MultiCore(); + protected static final CoreContainer multicore = new CoreContainer(); @Override public String getSolrHome() { return "../../../example/multicore/"; } diff --git a/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java index 82a99d73cd2..17baea1805a 100644 --- a/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java +++ b/client/java/solrj/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java @@ -76,6 +76,7 @@ public class JettyWebappTest extends TestCase assertNotNull( html ); // real error will be an exception adminPath += "admin/"; + html = IOUtils.toString( new URL(adminPath).openStream() ); assertNotNull( html ); // real error will be an exception // analysis diff --git a/example/solr/conf/schema.xml b/example/solr/conf/schema.xml index ed27785ac60..6cdeebc9fc2 100755 --- a/example/solr/conf/schema.xml +++ b/example/solr/conf/schema.xml @@ -204,6 +204,14 @@ + + + + + + + +