Class ConcurrentUpdateSolrClient.Builder
- java.lang.Object
- 
- org.apache.solr.client.solrj.impl.SolrClientBuilder<ConcurrentUpdateSolrClient.Builder>
- 
- org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.Builder
 
 
- 
- Enclosing class:
- ConcurrentUpdateSolrClient
 
 public static class ConcurrentUpdateSolrClient.Builder extends SolrClientBuilder<ConcurrentUpdateSolrClient.Builder> ConstructsConcurrentUpdateSolrClientinstances from provided configuration.
- 
- 
Field SummaryFields Modifier and Type Field Description protected StringbaseSolrUrlprotected ExecutorServiceexecutorServiceprotected intqueueSizeprotected booleanstreamDeletesprotected intthreadCount- 
Fields inherited from class org.apache.solr.client.solrj.impl.SolrClientBuilderconnectionTimeoutMillis, httpClient, responseParser, socketTimeoutMillis
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ConcurrentUpdateSolrClient.BuilderalwaysStreamDeletes()Configures created clients to always stream delete requests.ConcurrentUpdateSolrClientbuild()Create aConcurrentUpdateSolrClientbased on the provided configuration options.ConcurrentUpdateSolrClient.BuildergetThis()The solution for the unchecked cast warning.ConcurrentUpdateSolrClient.BuilderneverStreamDeletes()Configures created clients to not stream delete requests.ConcurrentUpdateSolrClient.BuilderwithExecutorService(ExecutorService executorService)Provides theExecutorServicefor the created client to use when servicing the update-request queue.ConcurrentUpdateSolrClient.BuilderwithQueueSize(int queueSize)The maximum number of requests buffered by the SolrClient's internal queue before being processed by background threads.ConcurrentUpdateSolrClient.BuilderwithThreadCount(int threadCount)The maximum number of threads used to emptyConcurrentUpdateSolrClients queue.- 
Methods inherited from class org.apache.solr.client.solrj.impl.SolrClientBuilderwithConnectionTimeout, withHttpClient, withResponseParser, withSocketTimeout
 
- 
 
- 
- 
- 
Field Detail- 
baseSolrUrlprotected String baseSolrUrl 
 - 
queueSizeprotected int queueSize 
 - 
threadCountprotected int threadCount 
 - 
executorServiceprotected ExecutorService executorService 
 - 
streamDeletesprotected boolean streamDeletes 
 
- 
 - 
Constructor Detail- 
Builderpublic Builder(String baseSolrUrl) Create a Builder object, based on the provided Solr URL. Two different paths can be specified as a part of this URL: 1) A path pointing directly at a particular coreSolrClient client = new ConcurrentUpdateSolrClient.Builder("http://my-solr-server:8983/solr/core1").build(); QueryResponse resp = client.query(new SolrQuery("*:*"));Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the core explicitly. However, the client can only send requests to that core. 2) The path of the root Solr path ("/solr")SolrClient client = new ConcurrentUpdateSolrClient.Builder("http://my-solr-server:8983/solr").build(); QueryResponse resp = client.query("core1", new SolrQuery("*:*"));In this case the client is more flexible and can be used to send requests to any cores. This flexibility though requires that the core be specified on all requests.
 
- 
 - 
Method Detail- 
withQueueSizepublic ConcurrentUpdateSolrClient.Builder withQueueSize(int queueSize) The maximum number of requests buffered by the SolrClient's internal queue before being processed by background threads. This value should be carefully paired with the number of queue-consumer threads. A queue with a maximum size set too high may require more memory. A queue with a maximum size set too low may suffer decreased throughput asSolrClient.request(SolrRequest)calls block waiting to add requests to the queue. If not set, this defaults to 10.- See Also:
- withThreadCount(int)
 
 - 
withThreadCountpublic ConcurrentUpdateSolrClient.Builder withThreadCount(int threadCount) The maximum number of threads used to emptyConcurrentUpdateSolrClients queue. Threads are created when documents are added to the client's internal queue and exit when no updates remain in the queue.This value should be carefully paired with the maximum queue capacity. A client with too few threads may suffer decreased throughput as the queue fills up and SolrClient.request(SolrRequest)calls block waiting to add requests to the queue.
 - 
withExecutorServicepublic ConcurrentUpdateSolrClient.Builder withExecutorService(ExecutorService executorService) Provides theExecutorServicefor the created client to use when servicing the update-request queue.
 - 
alwaysStreamDeletespublic ConcurrentUpdateSolrClient.Builder alwaysStreamDeletes() Configures created clients to always stream delete requests. Streamed deletes are put into the update-queue and executed like any other update request.
 - 
neverStreamDeletespublic ConcurrentUpdateSolrClient.Builder neverStreamDeletes() Configures created clients to not stream delete requests. With this option set when the created ConcurrentUpdateSolrClient sents a delete request it will first will lock the queue and block until all queued updates have been sent, and then send the delete request.
 - 
buildpublic ConcurrentUpdateSolrClient build() Create aConcurrentUpdateSolrClientbased on the provided configuration options.
 - 
getThispublic ConcurrentUpdateSolrClient.Builder getThis() Description copied from class:SolrClientBuilderThe solution for the unchecked cast warning.- Specified by:
- getThisin class- SolrClientBuilder<ConcurrentUpdateSolrClient.Builder>
 
 
- 
 
-