diff --git a/solr/core/src/java/org/apache/solr/update/UpdateHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateHandler.java index 380c251dd49..26267d96e3e 100644 --- a/solr/core/src/java/org/apache/solr/update/UpdateHandler.java +++ b/solr/core/src/java/org/apache/solr/update/UpdateHandler.java @@ -52,7 +52,7 @@ public abstract class UpdateHandler implements SolrInfoMBean { protected Vector softCommitCallbacks = new Vector(); protected Vector optimizeCallbacks = new Vector(); - protected UpdateLog ulog; + protected final UpdateLog ulog; private void parseEventListeners() { final Class clazz = SolrEventListener.class; @@ -71,18 +71,6 @@ public abstract class UpdateHandler implements SolrInfoMBean { } } - - private void initLog(PluginInfo ulogPluginInfo, UpdateLog existingUpdateLog) { - ulog = existingUpdateLog; - if (ulog == null && ulogPluginInfo != null && ulogPluginInfo.isEnabled()) { - ulog = new UpdateLog(); - ulog.init(ulogPluginInfo); - // ulog = core.createInitInstance(ulogPluginInfo, UpdateLog.class, "update log", "solr.NullUpdateLog"); - ulog.init(this, core); - } - // ulog.init() when reusing an existing log is deferred (currently at the end of the DUH2 constructor - } - // not thread safe - for startup private void clearLog(PluginInfo ulogPluginInfo) { if (ulogPluginInfo == null) return; @@ -132,7 +120,16 @@ public abstract class UpdateHandler implements SolrInfoMBean { if (!core.isReloaded() && !core.getDirectoryFactory().isPersistent()) { clearLog(ulogPluginInfo); } - initLog(ulogPluginInfo, updateLog); + + if (updateLog == null && ulogPluginInfo != null && ulogPluginInfo.isEnabled()) { + ulog = new UpdateLog(); + ulog.init(ulogPluginInfo); + // ulog = core.createInitInstance(ulogPluginInfo, UpdateLog.class, "update log", "solr.NullUpdateLog"); + ulog.init(this, core); + } else { + ulog = updateLog; + } + // ulog.init() when reusing an existing log is deferred (currently at the end of the DUH2 constructor } /**