public class ConcurrentUpdateSolrClient extends SolrClient
UpdateRequest
are 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 class HttpSolrClient
is better suited for the
query interface.Constructor and Description |
---|
ConcurrentUpdateSolrClient(String solrServerUrl,
org.apache.http.client.HttpClient client,
int queueSize,
int threadCount) |
ConcurrentUpdateSolrClient(String solrServerUrl,
org.apache.http.client.HttpClient client,
int queueSize,
int threadCount,
ExecutorService es)
Uses the supplied HttpClient to send documents to the Solr server.
|
ConcurrentUpdateSolrClient(String solrServerUrl,
org.apache.http.client.HttpClient client,
int queueSize,
int threadCount,
ExecutorService es,
boolean streamDeletes)
Uses the supplied HttpClient to send documents to the Solr server.
|
ConcurrentUpdateSolrClient(String solrServerUrl,
int queueSize,
int threadCount)
Uses an internally managed HttpClient instance.
|
Modifier and Type | Method and Description |
---|---|
void |
blockUntilFinished() |
void |
close() |
Set<String> |
getQueryParams() |
void |
handleError(Throwable ex) |
void |
onSuccess(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 collection
|
void |
setConnectionTimeout(int timeout) |
void |
setParser(ResponseParser responseParser) |
void |
setPollQueueTime(int pollQueueTime) |
void |
setQueryParams(Set<String> queryParams)
Expert Method.
|
void |
setRequestWriter(RequestWriter requestWriter) |
void |
setSoTimeout(int timeout)
set soTimeout (read timeout) on the underlying HttpConnectionManager.
|
void |
shutdownNow() |
add, 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
public ConcurrentUpdateSolrClient(String solrServerUrl, int queueSize, int threadCount)
solrServerUrl
- The Solr server URLqueueSize
- The buffer size before the documents are sent to the serverthreadCount
- The number of background threads used to empty the queuepublic ConcurrentUpdateSolrClient(String solrServerUrl, org.apache.http.client.HttpClient client, int queueSize, int threadCount)
public ConcurrentUpdateSolrClient(String solrServerUrl, org.apache.http.client.HttpClient client, int queueSize, int threadCount, ExecutorService es)
public ConcurrentUpdateSolrClient(String solrServerUrl, org.apache.http.client.HttpClient client, int queueSize, int threadCount, ExecutorService es, boolean streamDeletes)
public void setQueryParams(Set<String> queryParams)
queryParams
- set of param keys to only send via the query stringpublic NamedList<Object> request(SolrRequest request, String collection) throws SolrServerException, IOException
SolrClient
request
in class SolrClient
request
- the request to executecollection
- the collection to execute the request againstNamedList
containing the response from the serverSolrServerException
- if there is an error on the serverIOException
- If there is a low-level I/O error.public void blockUntilFinished()
public void handleError(Throwable ex)
public void onSuccess(org.apache.http.HttpResponse resp)
public void close()
public void setConnectionTimeout(int timeout)
public void setSoTimeout(int timeout)
public void shutdownNow()
public void setParser(ResponseParser responseParser)
public void setPollQueueTime(int pollQueueTime)
pollQueueTime
- time for an open connection to wait for updates when
the queue is empty.public void setRequestWriter(RequestWriter requestWriter)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.