public class ConcurrentUpdateSolrServer extends SolrServer
HttpSolrServer is better suited for the
query interface.| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ConcurrentUpdateSolrServer.Runner
Opens a connection and sends everything...
|
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.concurrent.CountDownLatch |
lock |
(package private) static org.slf4j.Logger |
log |
(package private) java.util.concurrent.BlockingQueue<UpdateRequest> |
queue |
(package private) java.util.Queue<ConcurrentUpdateSolrServer.Runner> |
runners |
(package private) java.util.concurrent.ExecutorService |
scheduler |
private static long |
serialVersionUID |
private HttpSolrServer |
server |
(package private) int |
threadCount |
(package private) java.lang.String |
updateUrl |
| Constructor and Description |
|---|
ConcurrentUpdateSolrServer(java.lang.String solrServerUrl,
org.apache.http.client.HttpClient client,
int queueSize,
int threadCount)
Uses the supplied HttpClient to send documents to the Solr server, the
HttpClient should be instantiated using a
ThreadSafeClientConnManager.
|
ConcurrentUpdateSolrServer(java.lang.String solrServerUrl,
int queueSize,
int threadCount)
Uses an internal ThreadSafeClientConnManager to manage http
connections.
|
| Modifier and Type | Method and Description |
|---|---|
void |
blockUntilFinished() |
void |
handleError(java.lang.Throwable ex) |
NamedList<java.lang.Object> |
request(SolrRequest request)
SolrServer implementations need to implement how a request is actually processed
|
void |
setParser(ResponseParser responseParser) |
void |
setRequestWriter(RequestWriter requestWriter) |
void |
shutdown() |
void |
shutdownNow() |
add, add, add, add, addBean, addBean, addBeans, addBeans, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, getBinder, optimize, optimize, optimize, ping, query, query, rollbackprivate static final long serialVersionUID
static final org.slf4j.Logger log
private HttpSolrServer server
final java.util.concurrent.BlockingQueue<UpdateRequest> queue
final java.util.concurrent.ExecutorService scheduler
final java.lang.String updateUrl
final java.util.Queue<ConcurrentUpdateSolrServer.Runner> runners
volatile java.util.concurrent.CountDownLatch lock
final int threadCount
public ConcurrentUpdateSolrServer(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.MalformedURLExceptionpublic ConcurrentUpdateSolrServer(java.lang.String solrServerUrl,
org.apache.http.client.HttpClient client,
int queueSize,
int threadCount)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic NamedList<java.lang.Object> request(SolrRequest request) throws SolrServerException, java.io.IOException
SolrServerrequest in class SolrServerSolrServerExceptionjava.io.IOExceptionpublic void blockUntilFinished()
public void handleError(java.lang.Throwable ex)
public void shutdown()
public void shutdownNow()
public void setParser(ResponseParser responseParser)
public void setRequestWriter(RequestWriter requestWriter)