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.
  • Field Details

    • minConnTimeout

      protected static final int minConnTimeout
    • minSocketTimeout

      protected static final int minSocketTimeout
    • httpSolrClients

      protected final Map<String,org.apache.solr.client.solrj.SolrClient> 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(since="10.1") public void setBasicAuthCredentials(String basicAuthCredentials)
      Deprecated.
    • getCloudSolrClient

      @Deprecated(since="10.1") public org.apache.solr.client.solrj.impl.CloudSolrClient getCloudSolrClient(String solrConnectionString)
    • 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

      public org.apache.solr.client.solrj.SolrClient getHttpSolrClient(String url)
      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:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable