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:36:12 UTC

lucene-solr:branch_7x: SOLR-11256: The queue size for ConcurrentUpdateSolrClient should default to 10 instead of throwing an IllegalArgumentException

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 4fafbccda -> d9047125f


SOLR-11256: 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/d9047125
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d9047125
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d9047125

Branch: refs/heads/branch_7x
Commit: d9047125f97b682f7046b649b20cf54afba0225d
Parents: 4fafbcc
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:35:15 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/d9047125/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 86ea34e..1d57a95 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -135,6 +135,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/d9047125/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/d9047125/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
+    }
+  }
 }