Interface SolrClientPool
-
- All Known Implementing Classes:
DefaultSolrClientPool
public interface SolrClientPoolPool forSolrClientinstances. All communications with Solr should use clients returned from methods in this class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CachedSolrClientgetOrCreate(Index index, SolrClientType solrClientType, java.util.function.Function<SolrConfig,org.apache.solr.client.solrj.SolrClient> createMethod)Returns aSolrClientfrom the pool or creates it if it does not exist.CachedSolrClientgetOrCreate(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)Returns aSolrClientfrom the pool or creates it if it does not exist.voidinvalidateAll()Invalidates the clients pool.
-
-
-
Method Detail
-
getOrCreate
CachedSolrClient getOrCreate(Index index, SolrClientType solrClientType, java.util.function.Function<SolrConfig,org.apache.solr.client.solrj.SolrClient> createMethod) throws SolrServiceException
Returns 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, 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 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.
-
-