Class DefaultSolrClientPool
java.lang.Object
de.hybris.platform.solrfacetsearch.solr.impl.DefaultSolrClientPool
- All Implemented Interfaces:
SolrClientPool,org.springframework.beans.factory.InitializingBean
public class DefaultSolrClientPool
extends Object
implements SolrClientPool, org.springframework.beans.factory.InitializingBean
Default implementation for
SolrClientPool.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected SolrClientsWrappercheck(String solrServerConfigName, SolrClientsWrapper clientsWrapper) protected voidcheckAll()protected CachedSolrClientcreateSolrClient(SolrConfig solrConfig, SolrClientConfig solrClientConfig, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) protected TenantListenerprotected voidprotected SolrClientsWrapperdoGetOrCreate(SolrConfig solrConfig, SolrClientsWrapper clientsWrapper, SolrClientType clientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) getOrCreate(Index index, SolrClientType clientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod) Returns aSolrClientfrom the pool or creates it if it does not exist.getOrCreate(Index index, SolrClientType clientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) Returns aSolrClientfrom the pool or creates it if it does not exist.protected ScheduledExecutorServiceprotected ConcurrentMap<String,SolrClientsWrapper> protected Stringprotected voidvoidInvalidates the clients pool.protected SolrServerConfigModelloadSolrServerConfig(String name) protected CachedSolrClientresolveSolrClient(SolrClientsWrapper clientsWrapper, SolrClientType solrClientType) voidsetConfigurationService(ConfigurationService configurationService) voidsetModelService(ModelService modelService) voidsetSessionService(SessionService sessionService) voidsetSolrServerConfigConverter(Converter<SolrServerConfigModel, SolrConfig> solrServerConfigConverter) voidsetSolrServerConfigDao(SolrServerConfigDao solrServerConfigDao) voidsetTenantService(TenantService tenantService) protected voidprotected void
-
Field Details
-
INDEX_PARAM
- See Also:
-
SOLR_CLIENT_PARAM
- See Also:
-
CREATE_METHOD_PARAM
- See Also:
-
CHECK_INTERVAL_PROPERTY
- See Also:
-
CHECK_INTERVAL_DEFAULT_VALUE
protected static final long CHECK_INTERVAL_DEFAULT_VALUE- See Also:
-
CHECK_THREAD_NAME_PREFIX
- See Also:
-
SCHEDULER_TERMINATION_TIMEOUT
protected static final long SCHEDULER_TERMINATION_TIMEOUT- See Also:
-
-
Constructor Details
-
DefaultSolrClientPool
public DefaultSolrClientPool()
-
-
Method Details
-
getTenantId
-
getScheduler
-
getSolrClients
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getOrCreate
public CachedSolrClient getOrCreate(Index index, SolrClientType clientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod) throws SolrServiceExceptionDescription copied from interface:SolrClientPoolReturns aSolrClientfrom the pool or creates it if it does not exist.- Specified by:
getOrCreatein interfaceSolrClientPool- Parameters:
index- -IndexclientType- -SolrClientTypecreateMethod- - method used to create a new instance ofSolrClient- Returns:
SolrClient- Throws:
SolrServiceException- if an error occurs
-
getOrCreate
public CachedSolrClient getOrCreate(Index index, SolrClientType clientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) throws SolrServiceExceptionDescription copied from interface:SolrClientPoolReturns aSolrClientfrom the pool or creates it if it does not exist.- Specified by:
getOrCreatein interfaceSolrClientPool- Parameters:
index- -IndexclientType- -SolrClientTypecreateMethod- - method used to create a new instance ofSolrClientcloseMethod- - method used to release resources associated with the created instance ofSolrClient- Returns:
SolrClient- Throws:
SolrServiceException- if an error occurs
-
invalidateAll
public void invalidateAll()Description copied from interface:SolrClientPoolInvalidates the clients pool.- Specified by:
invalidateAllin interfaceSolrClientPool
-
resolveSolrClient
protected CachedSolrClient resolveSolrClient(SolrClientsWrapper clientsWrapper, SolrClientType solrClientType) -
doGetOrCreate
protected SolrClientsWrapper doGetOrCreate(SolrConfig solrConfig, SolrClientsWrapper clientsWrapper, SolrClientType clientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) -
createSolrClient
protected CachedSolrClient createSolrClient(SolrConfig solrConfig, SolrClientConfig solrClientConfig, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) -
createTenantListener
-
loadSolrServerConfig
-
startCleanUpThread
protected void startCleanUpThread() -
stopCleanUpThread
protected void stopCleanUpThread() -
initializeSession
protected void initializeSession() -
checkAll
protected void checkAll() -
check
-
destroySession
protected void destroySession() -
getModelService
-
setModelService
-
getConfigurationService
-
setConfigurationService
-
getTenantService
-
setTenantService
-
getSessionService
-
setSessionService
-
getSolrServerConfigDao
-
setSolrServerConfigDao
-
getSolrServerConfigConverter
-
setSolrServerConfigConverter
public void setSolrServerConfigConverter(Converter<SolrServerConfigModel, SolrConfig> solrServerConfigConverter)
-