SOLR-4604: UpdateLog#init is over called on SolrCore#reload

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1457646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-03-18 05:27:15 +00:00
parent f33c2917e3
commit 5f618b8000
4 changed files with 14 additions and 5 deletions

View File

@ -157,8 +157,7 @@ Bug Fixes
* SOLR-4601: A Collection that is only partially created and then deleted will
leave pre allocated shard information in ZooKeeper. (Mark Miller)
* SOLR-4604: SolrCore is not using the UpdateHandler that is passed to it in
SolrCore#reload. (Mark Miller)
* SOLR-4604: UpdateLog#init is over called on SolrCore#reload. (Mark Miller)
Optimizations
----------------------

View File

@ -804,7 +804,9 @@ public final class SolrCore implements SolrInfoMBean {
this.updateHandler = createUpdateHandler(updateHandlerClass == null ? DirectUpdateHandler2.class
.getName() : updateHandlerClass);
} else {
this.updateHandler = updateHandler;
this.updateHandler = createUpdateHandler(
updateHandlerClass == null ? DirectUpdateHandler2.class.getName()
: updateHandlerClass, updateHandler);
}
infoRegistry.put("updateHandler", this.updateHandler);

View File

@ -110,7 +110,7 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
}
public DirectUpdateHandler2(SolrCore core, UpdateHandler updateHandler) {
super(core);
super(core, updateHandler.getUpdateLog());
solrCoreState = core.getSolrCoreState();
UpdateHandlerInfo updateHandlerInfo = core.getSolrConfig()

View File

@ -122,6 +122,10 @@ public abstract class UpdateHandler implements SolrInfoMBean {
}
public UpdateHandler(SolrCore core) {
this(core, null);
}
public UpdateHandler(SolrCore core, UpdateLog updateLog) {
this.core=core;
schema = core.getSchema();
idField = schema.getUniqueKeyField();
@ -131,7 +135,11 @@ public abstract class UpdateHandler implements SolrInfoMBean {
if (!core.isReloaded() && !core.getDirectoryFactory().isPersistent()) {
clearLog(ulogPluginInfo);
}
initLog(ulogPluginInfo);
if (updateLog == null) {
initLog(ulogPluginInfo);
} else {
this.ulog = updateLog;
}
}
/**