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.EVENT
with either theEventParams.NEW_SEARCHER
orEventParams.FIRST_SEARCHER
values depending on the value of currentSearcher.org.apache.solr.common.util.NamedList<?>
getArgs()
SolrCore
getCore()
void
init(org.apache.solr.common.util.NamedList<?> args)
init
will be called just once, immediately after creation.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 org.apache.solr.common.util.NamedList<?> getArgs()
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Description copied from interface:NamedListInitializedPlugin
init
will 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:
init
in interfaceNamedListInitializedPlugin
- Parameters:
args
- non-null list of initialization parameters (may be empty)
-
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 org.apache.solr.common.util.NamedList<Object> addEventParms(SolrIndexSearcher currentSearcher, org.apache.solr.common.util.NamedList<Object> 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
-
-