public abstract class SearchComponent extends Object implements SolrInfoBean, NamedListInitializedPlugin
SolrInfoBean.Category, SolrInfoBean.Group| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
metricNames |
protected com.codahale.metrics.MetricRegistry |
registry |
static Map<String,Class<? extends SearchComponent>> |
standard_components |
| Constructor and Description |
|---|
SearchComponent() |
| Modifier and Type | Method and Description |
|---|---|
int |
distributedProcess(ResponseBuilder rb)
Process for a distributed search.
|
void |
finishStage(ResponseBuilder rb)
Called after all responses have been received for this stage.
|
SolrInfoBean.Category |
getCategory()
Category of this component
|
abstract String |
getDescription()
Simple one or two line description
|
Set<String> |
getMetricNames()
Modifiable set of metric names that this component reports (default is null,
which means none).
|
com.codahale.metrics.MetricRegistry |
getMetricRegistry()
An instance of
MetricRegistry that this component uses for metrics reporting
(default is null, which means no registry). |
String |
getName()
Simple common usage name, e.g.
|
void |
handleResponses(ResponseBuilder rb,
ShardRequest sreq)
Called after all responses for a single request were received
|
void |
init(NamedList args) |
void |
modifyRequest(ResponseBuilder rb,
SearchComponent who,
ShardRequest sreq)
Called after another component adds a request
|
abstract void |
prepare(ResponseBuilder rb)
Prepare the response.
|
abstract void |
process(ResponseBuilder rb)
Process the request for this component
|
void |
setName(String name)
Sets the name of the SearchComponent.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetricsSnapshot, registerMetricNameprotected com.codahale.metrics.MetricRegistry registry
public static final Map<String,Class<? extends SearchComponent>> standard_components
public abstract void prepare(ResponseBuilder rb) throws IOException
process(org.apache.solr.handler.component.ResponseBuilder) method.
Called for every incoming request.
The place to do initialization that is request dependent.rb - The ResponseBuilderIOException - If there is a low-level I/O error.public abstract void process(ResponseBuilder rb) throws IOException
rb - The ResponseBuilderIOException - If there is a low-level I/O error.public int distributedProcess(ResponseBuilder rb) throws IOException
IOExceptionpublic void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)
public void handleResponses(ResponseBuilder rb, ShardRequest sreq)
public void finishStage(ResponseBuilder rb)
public void setName(String name)
public void init(NamedList args)
init in interface NamedListInitializedPluginpublic String getName()
SolrInfoBeangetName in interface SolrInfoBeanpublic abstract String getDescription()
SolrInfoBeangetDescription in interface SolrInfoBeanpublic SolrInfoBean.Category getCategory()
SolrInfoBeangetCategory in interface SolrInfoBeanpublic Set<String> getMetricNames()
SolrInfoBeanSolrInfoBean.registerMetricName(String)
to capture what metrics names are reported from this component.
NOTE: this set has to allow iteration under modifications.
getMetricNames in interface SolrInfoBeanpublic com.codahale.metrics.MetricRegistry getMetricRegistry()
SolrInfoBeanMetricRegistry that this component uses for metrics reporting
(default is null, which means no registry).getMetricRegistry in interface SolrInfoBeanCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.