Package org.ametys.cms.search.solr
Class AbstractAmetysConcurrentUpdateClient
- java.lang.Object
-
- org.apache.solr.client.solrj.SolrClient
-
- org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient
-
- org.ametys.cms.search.solr.AbstractAmetysConcurrentUpdateClient
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
- Direct Known Subclasses:
DefaultUpdateClient
,NoAutoCommitUpdateClient
public abstract class AbstractAmetysConcurrentUpdateClient extends org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient
Concurrent update solr client specific for Ametys.
Allow operations on only one collection (specified by the constructor), and forbid operations on all other collections. Delegate the processing to the ConcurrentUpdateSolrClient (superclass) if the collection is the one in use- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractAmetysConcurrentUpdateClient(String solrServerUrl, Optional<Integer> solrSocketTimeout, String collectionName, int queueSize, int threadCount, org.slf4j.Logger logger)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.solr.client.solrj.response.UpdateResponse
add(String collection, Collection<org.apache.solr.common.SolrInputDocument> docs)
org.apache.solr.client.solrj.response.UpdateResponse
add(String collection, Collection<org.apache.solr.common.SolrInputDocument> docs, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
add(String collection, Iterator<org.apache.solr.common.SolrInputDocument> docIterator)
org.apache.solr.client.solrj.response.UpdateResponse
add(String collection, org.apache.solr.common.SolrInputDocument doc)
org.apache.solr.client.solrj.response.UpdateResponse
add(String collection, org.apache.solr.common.SolrInputDocument doc, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
add(Collection<org.apache.solr.common.SolrInputDocument> docs)
org.apache.solr.client.solrj.response.UpdateResponse
add(Collection<org.apache.solr.common.SolrInputDocument> docs, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
add(Iterator<org.apache.solr.common.SolrInputDocument> docIterator)
org.apache.solr.client.solrj.response.UpdateResponse
add(org.apache.solr.common.SolrInputDocument doc)
org.apache.solr.client.solrj.response.UpdateResponse
add(org.apache.solr.common.SolrInputDocument doc, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
addBean(Object obj)
org.apache.solr.client.solrj.response.UpdateResponse
addBean(Object obj, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
addBean(String collection, Object obj)
org.apache.solr.client.solrj.response.UpdateResponse
addBean(String collection, Object obj, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
addBeans(String collection, Collection<?> beans)
org.apache.solr.client.solrj.response.UpdateResponse
addBeans(String collection, Collection<?> beans, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
addBeans(String collection, Iterator<?> beanIterator)
org.apache.solr.client.solrj.response.UpdateResponse
addBeans(Collection<?> beans)
org.apache.solr.client.solrj.response.UpdateResponse
addBeans(Collection<?> beans, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
addBeans(Iterator<?> beanIterator)
org.apache.solr.client.solrj.response.UpdateResponse
commit()
org.apache.solr.client.solrj.response.UpdateResponse
commit(boolean waitFlush, boolean waitSearcher)
org.apache.solr.client.solrj.response.UpdateResponse
commit(boolean waitFlush, boolean waitSearcher, boolean softCommit)
org.apache.solr.client.solrj.response.UpdateResponse
commit(String collection)
org.apache.solr.client.solrj.response.UpdateResponse
commit(String collection, boolean waitFlush, boolean waitSearcher)
org.apache.solr.client.solrj.response.UpdateResponse
commit(String collection, boolean waitFlush, boolean waitSearcher, boolean softCommit)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(String id)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(String id, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(String collection, String id)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(String collection, String id, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(String collection, List<String> ids)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(String collection, List<String> ids, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(List<String> ids)
org.apache.solr.client.solrj.response.UpdateResponse
deleteById(List<String> ids, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
deleteByQuery(String query)
org.apache.solr.client.solrj.response.UpdateResponse
deleteByQuery(String query, int commitWithinMs)
org.apache.solr.client.solrj.response.UpdateResponse
deleteByQuery(String collection, String query)
org.apache.solr.client.solrj.response.UpdateResponse
deleteByQuery(String collection, String query, int commitWithinMs)
void
handleError(Throwable t)
void
onSuccess(org.apache.http.HttpResponse resp)
org.apache.solr.client.solrj.response.UpdateResponse
optimize()
org.apache.solr.client.solrj.response.UpdateResponse
optimize(boolean waitFlush, boolean waitSearcher)
org.apache.solr.client.solrj.response.UpdateResponse
optimize(boolean waitFlush, boolean waitSearcher, int maxSegments)
org.apache.solr.client.solrj.response.UpdateResponse
optimize(String collection)
org.apache.solr.client.solrj.response.UpdateResponse
optimize(String collection, boolean waitFlush, boolean waitSearcher)
org.apache.solr.client.solrj.response.UpdateResponse
optimize(String collection, boolean waitFlush, boolean waitSearcher, int maxSegments)
org.apache.solr.client.solrj.response.UpdateResponse
rollback()
org.apache.solr.client.solrj.response.UpdateResponse
rollback(String collection)
-
Methods inherited from class org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient
blockUntilFinished, close, getQueryParams, request, setConnectionTimeout, setParser, setPollQueueTime, setQueryParams, setRequestWriter, setSoTimeout, shutdownNow
-
-
-
-
Constructor Detail
-
AbstractAmetysConcurrentUpdateClient
public AbstractAmetysConcurrentUpdateClient(String solrServerUrl, Optional<Integer> solrSocketTimeout, String collectionName, int queueSize, int threadCount, org.slf4j.Logger logger)
Constructor- Parameters:
solrServerUrl
- The Solr server URLsolrSocketTimeout
- The Solr socket timeout (in millis)collectionName
- The name of the collection, on which operations will be allowed. Operations on other collections will be forbidden.queueSize
- The buffer size before the documents are sent to the serverthreadCount
- The number of background threads used to empty the queuelogger
- internal logger
-
-
Method Detail
-
handleError
public void handleError(Throwable t)
- Overrides:
handleError
in classorg.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient
-
onSuccess
public void onSuccess(org.apache.http.HttpResponse resp)
- Overrides:
onSuccess
in classorg.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(String collection, Collection<org.apache.solr.common.SolrInputDocument> docs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(Collection<org.apache.solr.common.SolrInputDocument> docs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(String collection, Collection<org.apache.solr.common.SolrInputDocument> docs, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(Collection<org.apache.solr.common.SolrInputDocument> docs, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(String collection, org.apache.solr.common.SolrInputDocument doc) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(org.apache.solr.common.SolrInputDocument doc) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(String collection, org.apache.solr.common.SolrInputDocument doc, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(org.apache.solr.common.SolrInputDocument doc, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(String collection, Iterator<org.apache.solr.common.SolrInputDocument> docIterator) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
add
public org.apache.solr.client.solrj.response.UpdateResponse add(Iterator<org.apache.solr.common.SolrInputDocument> docIterator) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
add
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
addBean
public org.apache.solr.client.solrj.response.UpdateResponse addBean(String collection, Object obj) throws IOException, org.apache.solr.client.solrj.SolrServerException
- Overrides:
addBean
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
IOException
org.apache.solr.client.solrj.SolrServerException
-
addBean
public org.apache.solr.client.solrj.response.UpdateResponse addBean(Object obj) throws IOException, org.apache.solr.client.solrj.SolrServerException
- Overrides:
addBean
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
IOException
org.apache.solr.client.solrj.SolrServerException
-
addBean
public org.apache.solr.client.solrj.response.UpdateResponse addBean(String collection, Object obj, int commitWithinMs) throws IOException, org.apache.solr.client.solrj.SolrServerException
- Overrides:
addBean
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
IOException
org.apache.solr.client.solrj.SolrServerException
-
addBean
public org.apache.solr.client.solrj.response.UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, org.apache.solr.client.solrj.SolrServerException
- Overrides:
addBean
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
IOException
org.apache.solr.client.solrj.SolrServerException
-
addBeans
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(String collection, Collection<?> beans) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
addBeans
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
addBeans
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(Collection<?> beans) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
addBeans
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
addBeans
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(String collection, Collection<?> beans, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
addBeans
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
addBeans
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
addBeans
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
addBeans
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(String collection, Iterator<?> beanIterator) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
addBeans
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
addBeans
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(Iterator<?> beanIterator) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
addBeans
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
commit
public org.apache.solr.client.solrj.response.UpdateResponse commit(String collection) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
commit
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
commit
public org.apache.solr.client.solrj.response.UpdateResponse commit() throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
commit
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
commit
public org.apache.solr.client.solrj.response.UpdateResponse commit(String collection, boolean waitFlush, boolean waitSearcher) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
commit
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
commit
public org.apache.solr.client.solrj.response.UpdateResponse commit(boolean waitFlush, boolean waitSearcher) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
commit
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
commit
public org.apache.solr.client.solrj.response.UpdateResponse commit(String collection, boolean waitFlush, boolean waitSearcher, boolean softCommit) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
commit
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
commit
public org.apache.solr.client.solrj.response.UpdateResponse commit(boolean waitFlush, boolean waitSearcher, boolean softCommit) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
commit
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
optimize
public org.apache.solr.client.solrj.response.UpdateResponse optimize(String collection) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
optimize
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
optimize
public org.apache.solr.client.solrj.response.UpdateResponse optimize() throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
optimize
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
optimize
public org.apache.solr.client.solrj.response.UpdateResponse optimize(String collection, boolean waitFlush, boolean waitSearcher) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
optimize
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
optimize
public org.apache.solr.client.solrj.response.UpdateResponse optimize(boolean waitFlush, boolean waitSearcher) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
optimize
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
optimize
public org.apache.solr.client.solrj.response.UpdateResponse optimize(String collection, boolean waitFlush, boolean waitSearcher, int maxSegments) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
optimize
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
optimize
public org.apache.solr.client.solrj.response.UpdateResponse optimize(boolean waitFlush, boolean waitSearcher, int maxSegments) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
optimize
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
rollback
public org.apache.solr.client.solrj.response.UpdateResponse rollback(String collection) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
rollback
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
rollback
public org.apache.solr.client.solrj.response.UpdateResponse rollback() throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
rollback
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String collection, String id) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String id) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String collection, String id, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String id, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String collection, List<String> ids) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(List<String> ids) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String collection, List<String> ids, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteById
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(List<String> ids, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteById
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteByQuery
public org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(String collection, String query) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteByQuery
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteByQuery
public org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(String query) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteByQuery
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteByQuery
public org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(String collection, String query, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteByQuery
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
deleteByQuery
public org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(String query, int commitWithinMs) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Overrides:
deleteByQuery
in classorg.apache.solr.client.solrj.SolrClient
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
-