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 NamedList
addEventParms(SolrIndexSearcher currentSearcher, NamedList nlst)
Add theEventParams.EVENT
with either theEventParams.NEW_SEARCHER
orEventParams.FIRST_SEARCHER
values depending on the value of currentSearcher.NamedList
getArgs()
SolrCore
getCore()
void
init(NamedList args)
void
newSearcher(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.void
postCommit()
void
postSoftCommit()
String
toString()
-
-
-
Constructor Detail
-
AbstractSolrEventListener
public AbstractSolrEventListener(SolrCore core)
-
-
Method Detail
-
getCore
public SolrCore getCore()
-
getArgs
public NamedList getArgs()
-
init
public void init(NamedList args)
- Specified by:
init
in interfaceNamedListInitializedPlugin
-
postCommit
public void postCommit()
- Specified by:
postCommit
in interfaceSolrEventListener
-
postSoftCommit
public void postSoftCommit()
- Specified by:
postSoftCommit
in interfaceSolrEventListener
-
newSearcher
public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)
Description copied from interface:SolrEventListener
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.Implementations should add the
EventParams.EVENT
parameter 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:
newSearcher
in interfaceSolrEventListener
- Parameters:
newSearcher
- The newSolrIndexSearcher
to 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 NamedList addEventParms(SolrIndexSearcher currentSearcher, NamedList nlst)
Add theEventParams.EVENT
with either theEventParams.NEW_SEARCHER
orEventParams.FIRST_SEARCHER
values 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
-
-