Apache Lucene open-source search software
The queue size for ConcurrentUpdateSolrClient should default to 10 instead of throwing an IllegalArgumentException
Anshum Gupta8c855fa2870a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 849a49bc6ce..1387fd1add9 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 Solrdiff --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.javaindex f14d9533f33..d97bb2c03c9 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) {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.javaindex 5f986b73b50..504537b51c0 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+ }+ }}