Package org.apache.solr.client.solrj.io
Class SolrClientCache
- java.lang.Object
- 
- org.apache.solr.client.solrj.io.SolrClientCache
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public class SolrClientCache extends Object implements Closeable The SolrClientCache caches SolrClients, so they can be reused by different TupleStreams.
- 
- 
Constructor SummaryConstructors Constructor Description SolrClientCache()SolrClientCache(org.apache.http.client.HttpClient apacheHttpClient)Deprecated.SolrClientCache(org.apache.solr.client.solrj.impl.Http2SolrClient http2SolrClient)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.apache.solr.client.solrj.impl.CloudSolrClientgetCloudSolrClient(String zkHost)org.apache.solr.client.solrj.SolrClientgetHttpSolrClient(String baseUrl)Create (and cache) a SolrClient based around the provided URLvoidsetDefaultZKHost(String zkHost)
 
- 
- 
- 
Constructor Detail- 
SolrClientCachepublic SolrClientCache() 
 - 
SolrClientCache@Deprecated(since="9.0") public SolrClientCache(org.apache.http.client.HttpClient apacheHttpClient) Deprecated.
 - 
SolrClientCachepublic SolrClientCache(org.apache.solr.client.solrj.impl.Http2SolrClient http2SolrClient) 
 
- 
 - 
Method Detail- 
setDefaultZKHostpublic void setDefaultZKHost(String zkHost) 
 - 
getCloudSolrClientpublic org.apache.solr.client.solrj.impl.CloudSolrClient getCloudSolrClient(String zkHost) 
 - 
getHttpSolrClientpublic org.apache.solr.client.solrj.SolrClient getHttpSolrClient(String baseUrl) Create (and cache) a SolrClient based around the provided URL- Parameters:
- baseUrl- a Solr URL. May either be a "base" URL (i.e. ending in "/solr"), or point to a particular collection or core.
- Returns:
- a SolrClient configured to use the provided URL. The cache retains a reference to the
     returned client, and will close it when callers invoke close()
 
 - 
closepublic void close() - Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
- 
 
-