make ulog final and clean up a bit

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1494330 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-06-18 21:52:14 +00:00
parent f0b9fb280c
commit 625600da1c
1 changed files with 11 additions and 14 deletions

View File

@ -52,7 +52,7 @@ public abstract class UpdateHandler implements SolrInfoMBean {
protected Vector<SolrEventListener> softCommitCallbacks = new Vector<SolrEventListener>();
protected Vector<SolrEventListener> optimizeCallbacks = new Vector<SolrEventListener>();
protected UpdateLog ulog;
protected final UpdateLog ulog;
private void parseEventListeners() {
final Class<SolrEventListener> 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
}
/**