public class HttpShardHandlerFactory extends ShardHandlerFactory implements PluginInfoInitialized
Modifier and Type | Field and Description |
---|---|
protected org.apache.http.impl.conn.PoolingClientConnectionManager |
clientConnectionManager |
protected org.apache.http.impl.client.CloseableHttpClient |
defaultClient |
protected UpdateShardHandler.IdleConnectionsEvictor |
idleConnectionsEvictor |
DEFAULT_SHARDHANDLER_INFO
Constructor and Description |
---|
HttpShardHandlerFactory() |
Modifier and Type | Method and Description |
---|---|
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) |
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 ThreadPoolExecutor |
getThreadPoolExecutor() |
void |
init(PluginInfo info) |
LBHttpSolrClient.Rsp |
makeLoadBalancedRequest(QueryRequest req,
List<String> urls)
Makes a request to one or more of the given urls, using the configured load balancer.
|
List<String> |
makeURLList(String shard)
Creates a randomized list of urls for the given shard.
|
CompletionService |
newCompletionService()
Creates a new completion service for use by a single set of distributed requests.
|
void |
reconfigureHttpClient(HttpClientConfigurer configurer)
For an already created internal httpclient, this can be used to configure it
again.
|
newInstance
protected org.apache.http.impl.conn.PoolingClientConnectionManager clientConnectionManager
protected org.apache.http.impl.client.CloseableHttpClient defaultClient
protected UpdateShardHandler.IdleConnectionsEvictor idleConnectionsEvictor
public ShardHandler getShardHandler()
ShardHandler
that uses the default http client.getShardHandler
in class ShardHandlerFactory
public ShardHandler getShardHandler(org.apache.http.client.HttpClient httpClient)
ShardHandler
that uses custom http client.public void init(PluginInfo info)
init
in interface PluginInfoInitialized
protected ModifiableSolrParams getClientParams()
public void reconfigureHttpClient(HttpClientConfigurer configurer)
configurer
- an HttpClientConfigurer instanceprotected ThreadPoolExecutor 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 ShardHandlerFactory
public 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 acrossSolrServerException
IOException
public List<String> makeURLList(String shard)
shard
- the urls for the shard, separated by '|'public CompletionService newCompletionService()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.