You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2017/12/01 22:25:30 UTC
lucene-solr:master: The queue size for ConcurrentUpdateSolrClient
should default to 10 instead of throwing an IllegalArgumentException
Repository: lucene-solr
Updated Branches:
refs/heads/master f2dd3c5f8 -> 8c855fa28
The queue size for ConcurrentUpdateSolrClient should default to 10 instead of throwing an IllegalArgumentException
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8c855fa2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8c855fa2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8c855fa2
Branch: refs/heads/master
Commit: 8c855fa2870ad7ef3cc8450977f6e34b6d902d6b
Parents: f2dd3c5
Author: Anshum Gupta <an...@apache.org>
Authored: Fri Dec 1 14:24:15 2017 -0800
Committer: Anshum Gupta <an...@apache.org>
Committed: Fri Dec 1 14:25:02 2017 -0800
----------------------------------------------------------------------
solr/CHANGES.txt | 3 +++
.../solr/client/solrj/impl/ConcurrentUpdateSolrClient.java | 4 ++--
.../solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java | 8 ++++++++
3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8c855fa2/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 849a49b..1387fd1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -153,6 +153,9 @@ Bug Fixes
* SOLR-11608: Correctly parse the new core-name in the V2 core rename API.
(Jason Gerlowski via Anshum Gupta)
+* SOLR-11256: The queue size for ConcurrentUpdateSolrClient should default to 10 instead of throwing an
+ IllegalArgumentException. (Jason Gerlowski, Anshum Gupta)
+
Optimizations
----------------------
* SOLR-11285: Refactor autoscaling framework to avoid direct references to Zookeeper and Solr
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8c855fa2/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
index f14d953..d97bb2c 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
@@ -772,7 +772,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
*/
public static class Builder extends SolrClientBuilder<Builder> {
protected String baseSolrUrl;
- protected int queueSize;
+ protected int queueSize = 10;
protected int threadCount;
protected ExecutorService executorService;
protected boolean streamDeletes;
@@ -803,7 +803,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
}
/**
- * The number of documents to batch together before sending to Solr.
+ * The number of documents to batch together before sending to Solr. If not set, this defaults to 10.
*/
public Builder withQueueSize(int queueSize) {
if (queueSize <= 0) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8c855fa2/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
index 5f986b7..504537b 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
@@ -30,4 +30,12 @@ public class ConcurrentUpdateSolrClientBuilderTest extends LuceneTestCase {
public void testRejectsMissingBaseSolrUrl() {
new Builder(null).build();
}
+
+ @Test
+ public void testMissingQueueSize() {
+ try (ConcurrentUpdateSolrClient client = new Builder("someurl").build()){
+ // Do nothing as we just need to test that the only mandatory parameter for building the client
+ // is the baseSolrUrl
+ }
+ }
}