org.apache.solr.handler.component
Class HttpShardHandlerFactory

java.lang.Object
  extended by org.apache.solr.handler.component.ShardHandlerFactory
      extended by 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
           
 
Fields inherited from class org.apache.solr.handler.component.ShardHandlerFactory
DEFAULT_SHARDHANDLER_INFO
 
Constructor Summary
HttpShardHandlerFactory()
           
 
Method Summary
 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.
 
Methods inherited from class org.apache.solr.handler.component.ShardHandlerFactory
newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.slf4j.Logger log

defaultClient

protected org.apache.http.client.HttpClient defaultClient
Constructor Detail

HttpShardHandlerFactory

public HttpShardHandlerFactory()
Method Detail

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 balancer
urls - 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.