Class ConcurrentUpdateSolrClient
- java.lang.Object
- 
- org.apache.solr.client.solrj.SolrClient
- 
- org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient
 
 
- 
- All Implemented Interfaces:
- Closeable,- Serializable,- AutoCloseable
 
 public class ConcurrentUpdateSolrClient extends SolrClient ConcurrentUpdateSolrClient buffers all added documents and writes them into open HTTP connections. This class is thread safe. Params fromUpdateRequestare converted to http request parameters. When params change between UpdateRequests a new HTTP request is started. Although any SolrClient request can be made with this implementation, it is only recommended to use ConcurrentUpdateSolrClient with /update requests. The classHttpSolrClientis better suited for the query interface.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classConcurrentUpdateSolrClient.BuilderConstructsConcurrentUpdateSolrClientinstances from provided configuration.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedConcurrentUpdateSolrClient(String solrServerUrl, org.apache.http.client.HttpClient client, int queueSize, int threadCount, ExecutorService es, boolean streamDeletes)Deprecated.useConcurrentUpdateSolrClient(Builder)instead, as it is a more extension/subclassing-friendly alternativeprotectedConcurrentUpdateSolrClient(ConcurrentUpdateSolrClient.Builder builder)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidblockUntilFinished()voidclose()Set<String>getQueryParams()voidhandleError(Throwable ex)voidonSuccess(org.apache.http.HttpResponse resp)Intended to be used as an extension point for doing post processing after a request completes.NamedList<Object>request(SolrRequest request, String collection)Execute a request against a Solr server for a given collectionvoidsetConnectionTimeout(int timeout)Deprecated.since 7.0 UseConcurrentUpdateSolrClient.Buildermethods instead.voidsetParser(ResponseParser responseParser)voidsetPollQueueTime(int pollQueueTime)voidsetQueryParams(Set<String> queryParams)Expert Method.voidsetRequestWriter(RequestWriter requestWriter)voidsetSoTimeout(int timeout)Deprecated.since 7.0 UseConcurrentUpdateSolrClient.Buildermethods instead.voidshutdownNow()- 
Methods inherited from class org.apache.solr.client.solrj.SolrClientadd, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getBinder, getById, getById, getById, getById, getById, getById, getById, getById, optimize, optimize, optimize, optimize, optimize, optimize, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback
 
- 
 
- 
- 
- 
Constructor Detail- 
ConcurrentUpdateSolrClient@Deprecated protected ConcurrentUpdateSolrClient(String solrServerUrl, org.apache.http.client.HttpClient client, int queueSize, int threadCount, ExecutorService es, boolean streamDeletes) Deprecated.useConcurrentUpdateSolrClient(Builder)instead, as it is a more extension/subclassing-friendly alternativeUses the supplied HttpClient to send documents to the Solr server.
 - 
ConcurrentUpdateSolrClientprotected ConcurrentUpdateSolrClient(ConcurrentUpdateSolrClient.Builder builder) 
 
- 
 - 
Method Detail- 
setQueryParamspublic void setQueryParams(Set<String> queryParams) Expert Method.- Parameters:
- queryParams- set of param keys to only send via the query string
 
 - 
requestpublic NamedList<Object> request(SolrRequest request, String collection) throws SolrServerException, IOException Description copied from class:SolrClientExecute a request against a Solr server for a given collection- Specified by:
- requestin class- SolrClient
- Parameters:
- request- the request to execute
- collection- the collection to execute the request against
- Returns:
- a NamedListcontaining the response from the server
- Throws:
- SolrServerException- if there is an error on the server
- IOException- If there is a low-level I/O error.
 
 - 
blockUntilFinishedpublic void blockUntilFinished() 
 - 
handleErrorpublic void handleError(Throwable ex) 
 - 
onSuccesspublic void onSuccess(org.apache.http.HttpResponse resp) Intended to be used as an extension point for doing post processing after a request completes.
 - 
closepublic void close() 
 - 
setConnectionTimeout@Deprecated public void setConnectionTimeout(int timeout) Deprecated.since 7.0 UseConcurrentUpdateSolrClient.Buildermethods instead.
 - 
setSoTimeout@Deprecated public void setSoTimeout(int timeout) Deprecated.since 7.0 UseConcurrentUpdateSolrClient.Buildermethods instead.set soTimeout (read timeout) on the underlying HttpConnectionManager. This is desirable for queries, but probably not for indexing.
 - 
shutdownNowpublic void shutdownNow() 
 - 
setParserpublic void setParser(ResponseParser responseParser) 
 - 
setPollQueueTimepublic void setPollQueueTime(int pollQueueTime) - Parameters:
- pollQueueTime- time for an open connection to wait for updates when the queue is empty.
 
 - 
setRequestWriterpublic void setRequestWriter(RequestWriter requestWriter) 
 
- 
 
-