public class HttpShardHandlerFactory extends ShardHandlerFactory implements PluginInfoInitialized
Modifier and Type | Field and Description |
---|---|
protected org.apache.http.client.HttpClient |
defaultClient |
protected static org.slf4j.Logger |
log |
DEFAULT_SHARDHANDLER_INFO
Constructor and Description |
---|
HttpShardHandlerFactory() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected LBHttpSolrServer |
createLoadbalancer(org.apache.http.client.HttpClient httpClient) |
protected <T> T |
getParameter(NamedList initArgs,
String configKey,
T defaultValue) |
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) |
LBHttpSolrServer.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.
|
newInstance
protected static org.slf4j.Logger log
protected org.apache.http.client.HttpClient defaultClient
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 ThreadPoolExecutor getThreadPoolExecutor()
protected LBHttpSolrServer createLoadbalancer(org.apache.http.client.HttpClient httpClient)
public void close()
close
in class ShardHandlerFactory
public LBHttpSolrServer.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-2014 Apache Software Foundation. All Rights Reserved.