Class DefaultSolrClientPool

  • All Implemented Interfaces:
    SolrClientPool, org.springframework.beans.factory.InitializingBean

    public class DefaultSolrClientPool
    extends java.lang.Object
    implements SolrClientPool, org.springframework.beans.factory.InitializingBean
    Default implementation for SolrClientPool.
    • Field Detail

      • SOLR_CLIENT_PARAM

        protected static final java.lang.String SOLR_CLIENT_PARAM
        See Also:
        Constant Field Values
      • CREATE_METHOD_PARAM

        protected static final java.lang.String CREATE_METHOD_PARAM
        See Also:
        Constant Field Values
      • CHECK_INTERVAL_PROPERTY

        protected static final java.lang.String CHECK_INTERVAL_PROPERTY
        See Also:
        Constant Field Values
      • CHECK_INTERVAL_DEFAULT_VALUE

        protected static final long CHECK_INTERVAL_DEFAULT_VALUE
        See Also:
        Constant Field Values
      • CHECK_THREAD_NAME_PREFIX

        protected static final java.lang.String CHECK_THREAD_NAME_PREFIX
        See Also:
        Constant Field Values
      • SCHEDULER_TERMINATION_TIMEOUT

        protected static final long SCHEDULER_TERMINATION_TIMEOUT
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultSolrClientPool

        public DefaultSolrClientPool()
    • Method Detail

      • getTenantId

        protected java.lang.String getTenantId()
      • getScheduler

        protected java.util.concurrent.ScheduledExecutorService getScheduler()
      • getSolrClients

        protected java.util.concurrent.ConcurrentMap<java.lang.String,​SolrClientsWrapper> getSolrClients()
      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • getOrCreate

        public CachedSolrClient getOrCreate​(Index index,
                                            SolrClientType clientType,
                                            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
        Description copied from interface: SolrClientPool
        Returns a SolrClient from the pool or creates it if it does not exist.
        Specified by:
        getOrCreate in interface SolrClientPool
        Parameters:
        index - - Index
        clientType - - 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
      • createSolrClient

        protected CachedSolrClient createSolrClient​(SolrConfig solrConfig,
                                                    SolrClientConfig solrClientConfig,
                                                    java.util.function.Function<SolrConfig,​org.apache.solr.client.solrj.SolrClient> createMethod,
                                                    java.util.function.Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod)
      • createTenantListener

        protected TenantListener createTenantListener()
      • startCleanUpThread

        protected void startCleanUpThread()
      • stopCleanUpThread

        protected void stopCleanUpThread()
      • initializeSession

        protected void initializeSession()
      • checkAll

        protected void checkAll()
      • destroySession

        protected void destroySession()
      • setModelService

        public void setModelService​(ModelService modelService)
      • setConfigurationService

        public void setConfigurationService​(ConfigurationService configurationService)
      • setTenantService

        public void setTenantService​(TenantService tenantService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setSolrServerConfigDao

        public void setSolrServerConfigDao​(SolrServerConfigDao solrServerConfigDao)