public class AlfrescoHttpShardHandlerFactory
extends org.apache.solr.handler.component.ShardHandlerFactory
implements org.apache.solr.util.plugin.PluginInfoInitialized
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.client.HttpClient |
defaultClient |
protected static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
AlfrescoHttpShardHandlerFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected org.apache.solr.client.solrj.impl.LBHttpSolrServer |
createLoadbalancer(org.apache.http.client.HttpClient httpClient) |
protected <T> T |
getParameter(org.apache.solr.common.util.NamedList initArgs,
String configKey,
T defaultValue) |
org.apache.solr.handler.component.ShardHandler |
getShardHandler()
Get
ShardHandler that uses the default http client. |
org.apache.solr.handler.component.ShardHandler |
getShardHandler(org.apache.http.client.HttpClient httpClient)
Get
ShardHandler that uses custom http client. |
protected ThreadPoolExecutor |
getThreadPoolExecutor() |
void |
init(org.apache.solr.core.PluginInfo info) |
org.apache.solr.client.solrj.impl.LBHttpSolrServer.Rsp |
makeLoadBalancedRequest(AlfrescoQueryRequest 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.
|
protected static org.slf4j.Logger log
protected org.apache.http.client.HttpClient defaultClient
public org.apache.solr.handler.component.ShardHandler getShardHandler()
ShardHandler that uses the default http client.getShardHandler in class org.apache.solr.handler.component.ShardHandlerFactorypublic org.apache.solr.handler.component.ShardHandler getShardHandler(org.apache.http.client.HttpClient httpClient)
ShardHandler that uses custom http client.public void init(org.apache.solr.core.PluginInfo info)
init in interface org.apache.solr.util.plugin.PluginInfoInitializedprotected ThreadPoolExecutor getThreadPoolExecutor()
protected org.apache.solr.client.solrj.impl.LBHttpSolrServer createLoadbalancer(org.apache.http.client.HttpClient httpClient)
protected <T> T getParameter(org.apache.solr.common.util.NamedList initArgs,
String configKey,
T defaultValue)
public void close()
close in class org.apache.solr.handler.component.ShardHandlerFactorypublic org.apache.solr.client.solrj.impl.LBHttpSolrServer.Rsp makeLoadBalancedRequest(AlfrescoQueryRequest req, List<String> urls) throws org.apache.solr.client.solrj.SolrServerException, IOException
req - The solr search request that should be sent through the load balancerurls - The list of solr server urls to load balance acrossorg.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic List<String> makeURLList(String shard)
shard - the urls for the shard, separated by '|'public CompletionService newCompletionService()
Copyright © 2005–2017 Alfresco Software. All rights reserved.