org.apache.solr.handler.component
Class HttpShardHandlerFactory
java.lang.Object
org.apache.solr.handler.component.ShardHandlerFactory
org.apache.solr.handler.component.HttpShardHandlerFactory
- All Implemented Interfaces:
- PluginInfoInitialized
public class HttpShardHandlerFactory
- extends ShardHandlerFactory
- implements PluginInfoInitialized
Field Summary |
protected org.apache.http.client.HttpClient |
defaultClient
|
protected static org.slf4j.Logger |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.slf4j.Logger log
defaultClient
protected org.apache.http.client.HttpClient defaultClient
HttpShardHandlerFactory
public HttpShardHandlerFactory()
getShardHandler
public ShardHandler getShardHandler()
- Get
ShardHandler
that uses the default http client.
- Specified by:
getShardHandler
in class ShardHandlerFactory
getShardHandler
public ShardHandler getShardHandler(org.apache.http.client.HttpClient httpClient)
- Get
ShardHandler
that uses custom http client.
init
public void init(PluginInfo info)
- Specified by:
init
in interface PluginInfoInitialized
getThreadPoolExecutor
protected ThreadPoolExecutor getThreadPoolExecutor()
createLoadbalancer
protected LBHttpSolrServer createLoadbalancer(org.apache.http.client.HttpClient httpClient)
getParameter
protected <T> T getParameter(NamedList initArgs,
String configKey,
T defaultValue)
close
public void close()
- Specified by:
close
in class ShardHandlerFactory
makeLoadBalancedRequest
public LBHttpSolrServer.Rsp makeLoadBalancedRequest(QueryRequest req,
List<String> urls)
throws SolrServerException,
IOException
- Makes a request to one or more of the given urls, using the configured load balancer.
- Parameters:
req
- The solr search request that should be sent through the load balancerurls
- The list of solr server urls to load balance across
- Returns:
- The response from the request
- Throws:
SolrServerException
IOException
makeURLList
public List<String> makeURLList(String shard)
- Creates a randomized list of urls for the given shard.
- Parameters:
shard
- the urls for the shard, separated by '|'
- Returns:
- A list of valid urls (including protocol) that are replicas for the shard
newCompletionService
public CompletionService newCompletionService()
- Creates a new completion service for use by a single set of distributed requests.
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.