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 Summary
Modifier and TypeMethodDescriptiongetOrCreate(Index index, SolrClientType solrClientType, 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 solrClientType, 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.voidInvalidates the clients pool.
-
Method Details
-
getOrCreate
CachedSolrClient getOrCreate(Index index, SolrClientType solrClientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod) throws SolrServiceExceptionReturns aSolrClientfrom the pool or creates it if it does not exist.- Parameters:
index- -IndexsolrClientType- -SolrClientTypecreateMethod- - method used to create a new instance ofSolrClient- Returns:
SolrClient- Throws:
SolrServiceException- if an error occurs
-
getOrCreate
CachedSolrClient getOrCreate(Index index, SolrClientType solrClientType, Function<SolrConfig, org.apache.solr.client.solrj.SolrClient> createMethod, Consumer<org.apache.solr.client.solrj.SolrClient> closeMethod) throws SolrServiceExceptionReturns aSolrClientfrom the pool or creates it if it does not exist.- Parameters:
index- -IndexsolrClientType- -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
void invalidateAll()Invalidates the clients pool.
-