Package org.apache.solr.core
Class AbstractSolrEventListener
- java.lang.Object
-
- org.apache.solr.core.AbstractSolrEventListener
-
- All Implemented Interfaces:
SolrEventListener,NamedListInitializedPlugin
- Direct Known Subclasses:
ExternalFileFieldReloader,QuerySenderListener
public class AbstractSolrEventListener extends Object implements SolrEventListener
-
-
Constructor Summary
Constructors Constructor Description AbstractSolrEventListener(SolrCore core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.solr.common.util.NamedList<Object>addEventParms(SolrIndexSearcher currentSearcher, org.apache.solr.common.util.NamedList<Object> nlst)Add theEventParams.EVENTwith either theEventParams.NEW_SEARCHERorEventParams.FIRST_SEARCHERvalues depending on the value of currentSearcher.org.apache.solr.common.util.NamedList<?>getArgs()SolrCoregetCore()voidinit(org.apache.solr.common.util.NamedList<?> args)initwill be called just once, immediately after creation.voidnewSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)The searchers passed here are only guaranteed to be valid for the duration of this method call, so care should be taken not to spawn threads or asynchronous tasks with references to these searchers.voidpostCommit()voidpostSoftCommit()StringtoString()
-
-
-
Constructor Detail
-
AbstractSolrEventListener
public AbstractSolrEventListener(SolrCore core)
-
-
Method Detail
-
getCore
public SolrCore getCore()
-
getArgs
public org.apache.solr.common.util.NamedList<?> getArgs()
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Description copied from interface:NamedListInitializedPlugininitwill be called just once, immediately after creation.Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself
- Specified by:
initin interfaceNamedListInitializedPlugin- Parameters:
args- non-null list of initialization parameters (may be empty)
-
postCommit
public void postCommit()
- Specified by:
postCommitin interfaceSolrEventListener
-
postSoftCommit
public void postSoftCommit()
- Specified by:
postSoftCommitin interfaceSolrEventListener
-
newSearcher
public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)
Description copied from interface:SolrEventListenerThe searchers passed here are only guaranteed to be valid for the duration of this method call, so care should be taken not to spawn threads or asynchronous tasks with references to these searchers.Implementations should add the
EventParams.EVENTparameter and set it to a value of either:EventParams.FIRST_SEARCHER- First Searcher eventEventParams.NEW_SEARCHER- New Searcher event
if (currentSearcher != null) { nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER); } else { nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER); }- Specified by:
newSearcherin interfaceSolrEventListener- Parameters:
newSearcher- The newSolrIndexSearcherto usecurrentSearcher- The existingSolrIndexSearcher. null if this is a firstSearcher event.- See Also:
addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList)
-
addEventParms
protected org.apache.solr.common.util.NamedList<Object> addEventParms(SolrIndexSearcher currentSearcher, org.apache.solr.common.util.NamedList<Object> nlst)
Add theEventParams.EVENTwith either theEventParams.NEW_SEARCHERorEventParams.FIRST_SEARCHERvalues depending on the value of currentSearcher.Makes a copy of NamedList and then adds the parameters.
- Parameters:
currentSearcher- If null, add FIRST_SEARCHER, otherwise NEW_SEARCHERnlst- The named list to add the EVENT value to
-
-