Package org.apache.solr.client.solrj.io
Class SolrClientCache
java.lang.Object
org.apache.solr.client.solrj.io.SolrClientCache
- All Implemented Interfaces:
Closeable,AutoCloseable
The SolrClientCache caches SolrClients, so they can be reused by different TupleStreams.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSolrClientCache(org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 URLprotected org.apache.solr.client.solrj.impl.CloudSolrClientnewCloudSolrClient(String zkHost, org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient, boolean canUseACLs) protected org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<?, ?> newHttpSolrClientBuilder(String url, org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient) voidsetBasicAuthCredentials(String basicAuthCredentials) voidsetDefaultZKHost(String zkHost)
-
Field Details
-
basicAuthCredentials
-
-
Constructor Details
-
SolrClientCache
public SolrClientCache() -
SolrClientCache
public SolrClientCache(org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient)
-
-
Method Details
-
setBasicAuthCredentials
-
setDefaultZKHost
-
getCloudSolrClient
-
newCloudSolrClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient newCloudSolrClient(String zkHost, org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient, boolean canUseACLs) -
getHttpSolrClient
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()
-
newHttpSolrClientBuilder
protected org.apache.solr.client.solrj.impl.HttpSolrClientBuilderBase<?,?> newHttpSolrClientBuilder(String url, org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-