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
FieldsModifier and TypeFieldDescriptionprotected final Map<org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection, org.apache.solr.client.solrj.impl.CloudSolrClient> protected final org.apache.solr.client.solrj.impl.HttpSolrClientprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionSolrClientCache(org.apache.solr.client.solrj.impl.HttpSolrClient httpSolrClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.solr.client.solrj.impl.CloudSolrClientgetCloudSolrClient(String solrConnectionString) Deprecated.org.apache.solr.client.solrj.impl.CloudSolrClientgetCloudSolrClient(org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection solrConnection) org.apache.solr.client.solrj.SolrClientgetHttpSolrClient(String url) Create (and cache) a SolrClient based around the provided URLprotected booleanWhether this is Solr's own cache, the only kind permitted inside a Solr server.protected org.apache.solr.client.solrj.impl.CloudSolrClientnewCloudSolrClient(org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection cloudClientConnection) protected org.apache.solr.client.solrj.impl.CloudSolrClient.BuildernewCloudSolrClientBuilder(org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection cloudClientConnection) protected org.apache.solr.client.solrj.impl.HttpSolrClient.BuilderBase<?, ?> voidsetBasicAuthCredentials(String basicAuthCredentials) Deprecated.
-
Field Details
-
minConnTimeout
protected static final int minConnTimeout -
minSocketTimeout
protected static final int minSocketTimeout -
httpSolrClients
-
cloudSolClients
protected final Map<org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection,org.apache.solr.client.solrj.impl.CloudSolrClient> cloudSolClients -
httpSolrClient
protected final org.apache.solr.client.solrj.impl.HttpSolrClient httpSolrClient
-
-
Constructor Details
-
SolrClientCache
public SolrClientCache() -
SolrClientCache
public SolrClientCache(org.apache.solr.client.solrj.impl.HttpSolrClient httpSolrClient)
-
-
Method Details
-
isInternal
protected boolean isInternal()Whether this is Solr's own cache, the only kind permitted inside a Solr server. Only Solr's internal subclass returns true. -
setBasicAuthCredentials
Deprecated. -
getCloudSolrClient
@Deprecated(since="10.1") public org.apache.solr.client.solrj.impl.CloudSolrClient getCloudSolrClient(String solrConnectionString) Deprecated. -
getCloudSolrClient
public org.apache.solr.client.solrj.impl.CloudSolrClient getCloudSolrClient(org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection solrConnection) -
newCloudSolrClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient newCloudSolrClient(org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection cloudClientConnection) -
newCloudSolrClientBuilder
protected org.apache.solr.client.solrj.impl.CloudSolrClient.Builder newCloudSolrClientBuilder(org.apache.solr.client.solrj.impl.CloudSolrClient.CloudSolrClientConnection cloudClientConnection) -
getHttpSolrClient
Create (and cache) a SolrClient based around the provided URL- Parameters:
url- 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.HttpSolrClient.BuilderBase<?,?> newHttpSolrClientBuilder(String url) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getCloudSolrClient(CloudSolrClient.CloudSolrClientConnection)