public void addSolrServer(String server) throws MalformedURLException { HttpSolrClient client = makeSolrClient(server); addToAlive(new ServerWrapper(client)); }
public void addSolrServer(String server) throws MalformedURLException { HttpSolrClient client = makeSolrClient(server); addToAlive(new ServerWrapper(client)); }
protected LBHttpSolrClient(Builder builder) { this.clientIsInternal = builder.httpClient == null; this.httpSolrClientBuilder = builder.httpSolrClientBuilder; this.httpClient = builder.httpClient == null ? constructClient(builder.baseSolrUrls.toArray(new String[builder.baseSolrUrls.size()])) : builder.httpClient; this.connectionTimeout = builder.connectionTimeoutMillis; this.soTimeout = builder.socketTimeoutMillis; this.parser = builder.responseParser; if (! builder.baseSolrUrls.isEmpty()) { for (String s : builder.baseSolrUrls) { ServerWrapper wrapper = new ServerWrapper(makeSolrClient(s)); aliveServers.put(wrapper.getKey(), wrapper); } } updateAliveList(); }
HttpSolrClient client = makeSolrClient(serverStr);
try { MDC.put("LBHttpSolrClient.url", serverStr); HttpSolrClient client = makeSolrClient(serverStr);
/** The provided httpClient should use a multi-threaded connection manager */ public LBHttpSolrClient(HttpClient httpClient, ResponseParser parser, String... solrServerUrl) { clientIsInternal = (httpClient == null); this.parser = parser; if (httpClient == null) { ModifiableSolrParams params = new ModifiableSolrParams(); if (solrServerUrl.length > 1) { // we prefer retrying another server params.set(HttpClientUtil.PROP_USE_RETRY, false); } else { params.set(HttpClientUtil.PROP_USE_RETRY, true); } this.httpClient = HttpClientUtil.createClient(params); } else { this.httpClient = httpClient; } for (String s : solrServerUrl) { ServerWrapper wrapper = new ServerWrapper(makeSolrClient(s)); aliveServers.put(wrapper.getKey(), wrapper); } updateAliveList(); }