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

    • basicAuthCredentials

      protected String basicAuthCredentials
  • Constructor Details

    • SolrClientCache

      public SolrClientCache()
    • SolrClientCache

      public SolrClientCache(org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient)
  • Method Details

    • setBasicAuthCredentials

      public void setBasicAuthCredentials(String basicAuthCredentials)
    • setDefaultZKHost

      public void setDefaultZKHost(String zkHost)
    • getCloudSolrClient

      public org.apache.solr.client.solrj.impl.CloudSolrClient getCloudSolrClient(String zkHost)
    • newCloudSolrClient

      protected org.apache.solr.client.solrj.impl.CloudSolrClient newCloudSolrClient(String zkHost, org.apache.solr.client.solrj.impl.HttpSolrClientBase httpSolrClient, boolean canUseACLs)
    • getHttpSolrClient

      public 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()
    • 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:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable