Interface SolrClientPool

  • All Known Implementing Classes:
    DefaultSolrClientPool

    public interface SolrClientPool
    Pool for SolrClient instances. All communications with Solr should use clients returned from methods in this class.
    • Method Detail

      • getOrCreate

        CachedSolrClient getOrCreate​(Index index,
                                     SolrClientType solrClientType,
                                     java.util.function.Function<SolrConfig,​org.apache.solr.client.solrj.SolrClient> createMethod,
                                     java.util.function.Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod)
                              throws SolrServiceException
        Returns a SolrClient from the pool or creates it if it does not exist.
        Parameters:
        index - - Index
        solrClientType - - SolrClientType
        createMethod - - method used to create a new instance of SolrClient
        closeMethod - - method used to release resources associated with the created instance of SolrClient
        Returns:
        SolrClient
        Throws:
        SolrServiceException - if an error occurs
      • invalidateAll

        void invalidateAll()
        Invalidates the clients pool.