SOLR-5864: Remove previous SolrCore as parameter on reload

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1641819 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tomas Eduardo Fernandez Lobbe 2014-11-26 14:15:37 +00:00
parent 07b606bc88
commit d5f8b17e3f
3 changed files with 14 additions and 6 deletions

View File

@ -108,6 +108,9 @@ Upgrading from Solr 4.x
* AdminHandlers is deprecated , /admin/* are implicitly defined, /get ,/replacation and
handlers are also implicitly registered (refer to SOLR-6792)
* SolrCore.reload(ConfigSet coreConfig, SolrCore prev) was deprecated in 4.10.3 and
removed in 5.0. use SolrCore.reload(ConfigSet coreConfig). See SOLR-5864.
Detailed Change List
----------------------
@ -426,10 +429,13 @@ Other Changes
* SOLR-6751: Exceptions thrown in the analysis chain in DirectUpdateHandler2
should return a BAD_REQUEST status (Alan Woodward)
* SOLR-SOLR-6792 : deprecate AdminHandlers, Clean up solrconfig.xml of
* SOLR-6792 : deprecate AdminHandlers, Clean up solrconfig.xml of
unnecessary plugin definitions, implicit registration of /replication,
/get and /admin/* handlers (Noble Paul)
* SOLR-5864: Remove previous SolrCore as parameter on reload.
(Tomás Fernández Löbbe)
================== 4.10.3 ==================
Bug Fixes

View File

@ -22,7 +22,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -602,7 +601,7 @@ public class CoreContainer {
solrCores.waitAddPendingCoreOps(name);
ConfigSet coreConfig = coreConfigService.getConfig(cd);
log.info("Reloading SolrCore '{}' using configuration from {}", cd.getName(), coreConfig.getName());
SolrCore newCore = core.reload(coreConfig, core);
SolrCore newCore = core.reload(coreConfig);
registerCore(name, newCore, false);
}
catch (Exception e) {

View File

@ -423,18 +423,21 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
return responseWriters.put(name, responseWriter);
}
public SolrCore reload(ConfigSet coreConfig, SolrCore prev) throws IOException,
public SolrCore reload(ConfigSet coreConfig) throws IOException,
ParserConfigurationException, SAXException {
solrCoreState.increfSolrCoreState();
SolrCore currentCore;
boolean indexDirChange = !getNewIndexDir().equals(getIndexDir());
if (indexDirChange || !coreConfig.getSolrConfig().nrtMode) {
// the directory is changing, don't pass on state
prev = null;
currentCore = null;
} else {
currentCore = this;
}
SolrCore core = new SolrCore(getName(), getDataDir(), coreConfig.getSolrConfig(),
coreConfig.getIndexSchema(), coreDescriptor, updateHandler, this.solrDelPolicy, prev);
coreConfig.getIndexSchema(), coreDescriptor, updateHandler, this.solrDelPolicy, currentCore);
core.solrDelPolicy = this.solrDelPolicy;