ConcurrentUpdateSolrServer
instead.@Deprecated public class StreamingUpdateSolrServer extends CommonsHttpSolrServer
StreamingUpdateSolrServer
buffers all added documents and writes them
into open HTTP connections. This class is thread safe.
Although any SolrServer request can be made with this implementation,
it is only recommended to use StreamingUpdateSolrServer
with
/update requests. The base class {&link CommonsHttpSolrServer} is
better suited for the query interface, or for situations where you
need to detect errors or catch exceptions from udpate requests.Modifier and Type | Class and Description |
---|---|
(package private) class |
StreamingUpdateSolrServer.Runner
Deprecated.
Opens a connection and sends everything...
|
Modifier and Type | Field and Description |
---|---|
(package private) java.util.concurrent.CountDownLatch |
lock
Deprecated.
|
(package private) static org.slf4j.Logger |
log
Deprecated.
|
(package private) java.util.concurrent.BlockingQueue<UpdateRequest> |
queue
Deprecated.
|
(package private) java.util.Queue<StreamingUpdateSolrServer.Runner> |
runners
Deprecated.
|
(package private) java.util.concurrent.ExecutorService |
scheduler
Deprecated.
|
(package private) int |
threadCount
Deprecated.
|
(package private) java.lang.String |
updateUrl
Deprecated.
|
_baseURL, _invariantParams, _parser, AGENT, requestWriter
Constructor and Description |
---|
StreamingUpdateSolrServer(java.lang.String solrServerUrl,
org.apache.commons.httpclient.HttpClient client,
int queueSize,
int threadCount)
Deprecated.
Uses the supplied HttpClient to send documents to the Solr server, the HttpClient should be instantiated using a
MultiThreadedHttpConnectionManager.
|
StreamingUpdateSolrServer(java.lang.String solrServerUrl,
int queueSize,
int threadCount)
Deprecated.
Uses an internal MultiThreadedHttpConnectionManager to manage http connections
|
Modifier and Type | Method and Description |
---|---|
void |
blockUntilFinished()
Deprecated.
|
void |
handleError(java.lang.Throwable ex)
Deprecated.
|
NamedList<java.lang.Object> |
request(SolrRequest request)
Deprecated.
Process the request.
|
add, add, addBeans, addBeans, getBaseURL, getHttpClient, getInvariantParams, getParser, request, setAllowCompression, setBaseURL, setConnectionManagerTimeout, setConnectionManagerTimeout, setConnectionTimeout, setDefaultMaxConnectionsPerHost, setFollowRedirects, setMaxRetries, setMaxTotalConnections, setParser, setRequestWriter, setSoTimeout
add, add, add, add, addBean, addBean, addBeans, addBeans, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, getBinder, optimize, optimize, optimize, ping, query, query, rollback
static final org.slf4j.Logger log
final java.util.concurrent.BlockingQueue<UpdateRequest> queue
final java.util.concurrent.ExecutorService scheduler
final java.lang.String updateUrl
final java.util.Queue<StreamingUpdateSolrServer.Runner> runners
volatile java.util.concurrent.CountDownLatch lock
final int threadCount
public StreamingUpdateSolrServer(java.lang.String solrServerUrl, int queueSize, int threadCount) throws java.net.MalformedURLException
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 queuejava.net.MalformedURLException
public StreamingUpdateSolrServer(java.lang.String solrServerUrl, org.apache.commons.httpclient.HttpClient client, int queueSize, int threadCount) throws java.net.MalformedURLException
java.net.MalformedURLException
public NamedList<java.lang.Object> request(SolrRequest request) throws SolrServerException, java.io.IOException
CommonsHttpSolrServer
SolrRequest.getResponseParser()
is null, then use
CommonsHttpSolrServer.getParser()
request
in class CommonsHttpSolrServer
request
- The SolrRequest
to processNamedList
resultSolrServerException
java.io.IOException
CommonsHttpSolrServer.request(org.apache.solr.client.solrj.SolrRequest, org.apache.solr.client.solrj.ResponseParser)
public void blockUntilFinished()
public void handleError(java.lang.Throwable ex)