public class HttpShardHandlerFactory extends ShardHandlerFactory implements PluginInfoInitialized, SolrMetricProducer
| Modifier and Type | Field and Description |
|---|---|
protected InstrumentedPoolingHttpClientConnectionManager |
clientConnectionManager |
protected org.apache.http.impl.client.CloseableHttpClient |
defaultClient |
protected InstrumentedHttpRequestExecutor |
httpRequestExecutor |
protected Random |
r |
DEFAULT_SHARDHANDLER_INFO| Constructor and Description |
|---|
HttpShardHandlerFactory() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
buildURLList(String shard)
Creates a list of urls for the given shard.
|
void |
close() |
protected LBHttpSolrClient |
createLoadbalancer(org.apache.http.client.HttpClient httpClient) |
protected ModifiableSolrParams |
getClientParams() |
protected <T> T |
getParameter(NamedList initArgs,
String configKey,
T defaultValue,
StringBuilder sb) |
protected ReplicaListTransformer |
getReplicaListTransformer(SolrQueryRequest req) |
ShardHandler |
getShardHandler()
Get
ShardHandler that uses the default http client. |
ShardHandler |
getShardHandler(org.apache.http.client.HttpClient httpClient)
Get
ShardHandler that uses custom http client. |
protected ExecutorService |
getThreadPoolExecutor() |
void |
init(PluginInfo info) |
void |
initializeMetrics(SolrMetricManager manager,
String registry,
String tag,
String scope)
Initializes metrics specific to this producer.
|
LBHttpSolrClient.Rsp |
makeLoadBalancedRequest(QueryRequest req,
List<String> urls)
Makes a request to one or more of the given urls, using the configured load balancer.
|
CompletionService |
newCompletionService()
Creates a new completion service for use by a single set of distributed requests.
|
protected LBHttpSolrClient.Req |
newLBHttpSolrClientReq(QueryRequest req,
List<String> urls) |
newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeMetricsprotected InstrumentedPoolingHttpClientConnectionManager clientConnectionManager
protected org.apache.http.impl.client.CloseableHttpClient defaultClient
protected InstrumentedHttpRequestExecutor httpRequestExecutor
protected final Random r
public ShardHandler getShardHandler()
ShardHandler that uses the default http client.getShardHandler in class ShardHandlerFactorypublic ShardHandler getShardHandler(org.apache.http.client.HttpClient httpClient)
ShardHandler that uses custom http client.public void init(PluginInfo info)
init in interface PluginInfoInitializedprotected ModifiableSolrParams getClientParams()
protected ExecutorService getThreadPoolExecutor()
protected LBHttpSolrClient createLoadbalancer(org.apache.http.client.HttpClient httpClient)
protected <T> T getParameter(NamedList initArgs, String configKey, T defaultValue, StringBuilder sb)
public void close()
close in class ShardHandlerFactorypublic LBHttpSolrClient.Rsp makeLoadBalancedRequest(QueryRequest req, List<String> urls) throws SolrServerException, IOException
req - The solr search request that should be sent through the load balancerurls - The list of solr server urls to load balance acrossSolrServerExceptionIOExceptionprotected LBHttpSolrClient.Req newLBHttpSolrClientReq(QueryRequest req, List<String> urls)
public List<String> buildURLList(String shard)
shard - the urls for the shard, separated by '|'protected ReplicaListTransformer getReplicaListTransformer(SolrQueryRequest req)
public CompletionService newCompletionService()
public void initializeMetrics(SolrMetricManager manager, String registry, String tag, String scope)
SolrMetricProducerNote: for back-compatibility this method by default calls SolrMetricProducer.initializeMetrics(SolrMetricManager, String, String).
initializeMetrics in interface SolrMetricProducermanager - an instance of SolrMetricManagerregistry - registry name where metrics are registeredtag - symbolic tag that represents a group of related instances that
have the same life-cycle. Parent component can use the tag when
calling SolrMetricManager.unregisterGauges(String, String)
to unregister metrics created by this instance of the producer.scope - scope of the metrics (eg. handler name) to separate metrics of
instances of the same component executing in different contextsCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.