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, wait
getMetricsSnapshot, registerMetricName
protected 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 ResponseBuilder
IOException
- If there is a low-level I/O error.public abstract void process(ResponseBuilder rb) throws IOException
rb
- The ResponseBuilder
IOException
- If there is a low-level I/O error.public int distributedProcess(ResponseBuilder rb) throws IOException
IOException
public 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 NamedListInitializedPlugin
public String getName()
SolrInfoBean
getName
in interface SolrInfoBean
public abstract String getDescription()
SolrInfoBean
getDescription
in interface SolrInfoBean
public SolrInfoBean.Category getCategory()
SolrInfoBean
getCategory
in interface SolrInfoBean
public Set<String> getMetricNames()
SolrInfoBean
SolrInfoBean.registerMetricName(String)
to capture what metrics names are reported from this component.
NOTE: this set has to allow iteration under modifications.
getMetricNames
in interface SolrInfoBean
public com.codahale.metrics.MetricRegistry getMetricRegistry()
SolrInfoBean
MetricRegistry
that this component uses for metrics reporting
(default is null, which means no registry).getMetricRegistry
in interface SolrInfoBean
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.