lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ans...@apache.org
Subject [2/3] lucene-solr:branch_6x: SOLR-8097: Implement builder pattern design for constructing SolrJ clients and deprecate direct construction of clients
Date Fri, 08 Apr 2016 20:14:48 GMT
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
index 0951b5d..0873fa3 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
@@ -167,7 +167,7 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase {
 
       String url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), collection);
 
-      try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+      try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
         // poll for a second - it can take a moment before we are ready to serve
         waitForNon403or404or503(collectionClient);
       }
@@ -195,7 +195,7 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase {
     String url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), collectionName);
 
     String shard_fld = "shard_s";
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
 
       // lets try and use the solrj client to index a couple documents
   
@@ -292,12 +292,12 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase {
       url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), collectionName);
     }
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
          // poll for a second - it can take a moment before we are ready to serve
       waitForNon403or404or503(collectionClient);
     }
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
       // lets try and use the solrj client to index a couple documents
   
       collectionClient.add(getDoc(id, 6, i1, -600, tlong, 600, t1,
@@ -343,13 +343,13 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase {
 
     String url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), collectionName);
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
       // poll for a second - it can take a moment before we are ready to serve
       waitForNon403or404or503(collectionClient);
     }
 
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
       // lets try and use the solrj client to index a couple documents
   
       collectionClient.add(getDoc(id, 6, i1, -600, tlong, 600, t1,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
index 959d3b2..18a5f9c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteInactiveReplicaTest.java
@@ -128,7 +128,7 @@ public class DeleteInactiveReplicaTest extends AbstractFullDistribZkTestBase{
 
       Map m = Utils.makeMap("qt", "/admin/cores", "action", "status");
 
-      try (SolrClient queryClient = new HttpSolrClient(replica1.getStr(ZkStateReader.BASE_URL_PROP))) {
+      try (SolrClient queryClient = getHttpSolrClient(replica1.getStr(ZkStateReader.BASE_URL_PROP))) {
         NamedList<Object> resp = queryClient.request(new QueryRequest(new MapSolrParams(m)));
         assertNull("The core is up and running again",
             ((NamedList) resp.get("status")).get(replica1.getStr("core")));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
index f0d6484..bb8d3be 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
@@ -97,7 +97,7 @@ public class DeleteReplicaTest extends AbstractFullDistribZkTestBase {
       if (replica1 == null) fail("no active replicas found");
 
       String dataDir = null;
-      try (HttpSolrClient replica1Client = new HttpSolrClient(replica1.getStr("base_url"))) {
+      try (HttpSolrClient replica1Client = getHttpSolrClient(replica1.getStr("base_url"))) {
         CoreAdminResponse status = CoreAdminRequest.getStatus(replica1.getStr("core"), replica1Client);
         NamedList<Object> coreStatus = status.getCoreStatus(replica1.getStr("core"));
         dataDir = (String) coreStatus.get("dataDir");
@@ -186,7 +186,7 @@ public class DeleteReplicaTest extends AbstractFullDistribZkTestBase {
     String instanceDir;
     String dataDir;
 
-    try (HttpSolrClient client = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient client = getHttpSolrClient(baseUrl)) {
       CoreAdminResponse statusResp = CoreAdminRequest.getStatus(core, client);
       NamedList r = statusResp.getCoreStatus().get(core);
       instanceDir = (String) r.findRecursive("instanceDir");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
index 812fbe9..9097363 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteShardTest.java
@@ -121,7 +121,7 @@ public class DeleteShardTest extends AbstractFullDistribZkTestBase {
         .getBaseURL();
     baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length());
 
-    try (HttpSolrClient baseServer = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient baseServer = getHttpSolrClient(baseUrl)) {
       baseServer.setConnectionTimeout(15000);
       baseServer.setSoTimeout(60000);
       baseServer.request(request);
@@ -173,7 +173,7 @@ public class DeleteShardTest extends AbstractFullDistribZkTestBase {
     String instanceDir;
     String dataDir;
 
-    try (HttpSolrClient client = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient client = getHttpSolrClient(baseUrl)) {
       CoreAdminResponse statusResp = CoreAdminRequest.getStatus(core, client);
       NamedList r = statusResp.getCoreStatus().get(core);
       instanceDir = (String) r.findRecursive("instanceDir");
@@ -199,7 +199,7 @@ public class DeleteShardTest extends AbstractFullDistribZkTestBase {
     baseUrl = (String) leader.get("base_url");
     core = (String) leader.get("core");
 
-    try (HttpSolrClient client = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient client = getHttpSolrClient(baseUrl)) {
       CoreAdminResponse statusResp = CoreAdminRequest.getStatus(core, client);
       NamedList r = statusResp.getCoreStatus().get(core);
       instanceDir = (String) r.findRecursive("instanceDir");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
index 898f38a..812815b 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
@@ -105,7 +105,7 @@ public class DistributedVersionInfoTest extends AbstractFullDistribZkTestBase {
     assertEquals("leader and replica should have same max version: " + maxOnLeader, maxOnLeader, maxOnReplica);
 
     // send the same doc but with a lower version than the max in the index
-    try (SolrClient client = new HttpSolrClient(replica.getCoreUrl())) {
+    try (SolrClient client = getHttpSolrClient(replica.getCoreUrl())) {
       String docId = String.valueOf(1);
       SolrInputDocument doc = new SolrInputDocument();
       doc.setField(id, docId);
@@ -276,7 +276,7 @@ public class DistributedVersionInfoTest extends AbstractFullDistribZkTestBase {
     query.addSort(new SolrQuery.SortClause("_version_", SolrQuery.ORDER.desc));
     query.setParam("distrib", false);
 
-    try (SolrClient client = new HttpSolrClient(replica.getCoreUrl())) {
+    try (SolrClient client = getHttpSolrClient(replica.getCoreUrl())) {
       QueryResponse qr = client.query(query);
       SolrDocumentList hits = qr.getResults();
       if (hits.isEmpty())
@@ -343,7 +343,7 @@ public class DistributedVersionInfoTest extends AbstractFullDistribZkTestBase {
   }
 
   protected HttpSolrClient getHttpSolrClient(Replica replica) throws Exception {
-    return new HttpSolrClient(replica.getCoreUrl());
+    return getHttpSolrClient(replica.getCoreUrl());
   }
 
   protected void sendDoc(int docId) throws Exception {
@@ -378,7 +378,7 @@ public class DistributedVersionInfoTest extends AbstractFullDistribZkTestBase {
     ZkCoreNodeProps coreProps = new ZkCoreNodeProps(replica);
     String coreName = coreProps.getCoreName();
     boolean reloadedOk = false;
-    try (HttpSolrClient client = new HttpSolrClient(coreProps.getBaseUrl())) {
+    try (HttpSolrClient client = getHttpSolrClient(coreProps.getBaseUrl())) {
       CoreAdminResponse statusResp = CoreAdminRequest.getStatus(coreName, client);
       long leaderCoreStartTime = statusResp.getStartTime(coreName).getTime();
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
index a71c3e6..e9e8907 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ForceLeaderTest.java
@@ -301,7 +301,7 @@ public class ForceLeaderTest extends HttpPartitionTest {
 
     SolrRequest<SimpleSolrResponse> req = new GenericSolrRequest(METHOD.GET, "/admin/cores", params);
     NamedList resp = null;
-    try (HttpSolrClient hsc = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient hsc = getHttpSolrClient(baseUrl)) {
        resp = hsc.request(req);
     }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
index 2609914..e15ab0d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
@@ -698,7 +698,7 @@ public class FullSolrCloudDistribCmdsTest extends AbstractFullDistribZkTestBase
     QueryResponse results = query(cloudClient);
     long beforeCount = results.getResults().getNumFound();
     int cnt = TEST_NIGHTLY ? 2933 : 313;
-    try (ConcurrentUpdateSolrClient concurrentClient = new ConcurrentUpdateSolrClient(
+    try (ConcurrentUpdateSolrClient concurrentClient = getConcurrentUpdateSolrClient(
         ((HttpSolrClient) clients.get(0)).getBaseURL(), 10, 2)) {
       concurrentClient.setConnectionTimeout(120000);
       for (int i = 0; i < cnt; i++) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
index f1960aa..7e2c17d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
@@ -588,7 +588,7 @@ public class HttpPartitionTest extends AbstractFullDistribZkTestBase {
   protected HttpSolrClient getHttpSolrClient(Replica replica, String coll) throws Exception {
     ZkCoreNodeProps zkProps = new ZkCoreNodeProps(replica);
     String url = zkProps.getBaseUrl() + "/" + coll;
-    return new HttpSolrClient(url);
+    return getHttpSolrClient(url);
   }
 
   protected int sendDoc(int docId) throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnCommitTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnCommitTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnCommitTest.java
index 7d6c633..fd122ad 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnCommitTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnCommitTest.java
@@ -163,7 +163,7 @@ public class LeaderInitiatedRecoveryOnCommitTest extends BasicDistributedZkTest
     String replicaCoreUrl = replica.getCoreUrl();
     log.info("Sending commit request to: "+replicaCoreUrl);
     final RTimer timer = new RTimer();
-    try (HttpSolrClient client = new HttpSolrClient(replicaCoreUrl)) {
+    try (HttpSolrClient client = getHttpSolrClient(replicaCoreUrl)) {
       try {
         client.commit();
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnShardRestartTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnShardRestartTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnShardRestartTest.java
index d130f3b..928f4d6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnShardRestartTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/LeaderInitiatedRecoveryOnShardRestartTest.java
@@ -80,7 +80,7 @@ public class LeaderInitiatedRecoveryOnShardRestartTest extends AbstractFullDistr
     QueryRequest request = new QueryRequest(params);
     request.setPath("/admin/collections");
     String baseUrl = ((HttpSolrClient) clients.get(0)).getBaseURL();
-    HttpSolrClient delClient = new HttpSolrClient(baseUrl.substring(0, baseUrl.lastIndexOf("/")));
+    HttpSolrClient delClient = getHttpSolrClient(baseUrl.substring(0, baseUrl.lastIndexOf("/")));
     delClient.request(request);
     delClient.close();
     

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java b/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
index c09e0d1..fadb880 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MigrateRouteKeyTest.java
@@ -106,7 +106,7 @@ public class MigrateRouteKeyTest extends BasicDistributedZkTest {
         .getBaseURL();
     baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length());
 
-    try (HttpSolrClient baseClient = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient baseClient = getHttpSolrClient(baseUrl)) {
       baseClient.setConnectionTimeout(15000);
       baseClient.setSoTimeout(60000 * 5);
       baseClient.request(request);
@@ -161,7 +161,7 @@ public class MigrateRouteKeyTest extends BasicDistributedZkTest {
 
     String url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), targetCollection);
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
 
       SolrQuery solrQuery = new SolrQuery("*:*");
       assertEquals("DocCount on target collection does not match", 0, collectionClient.query(solrQuery).getResults().getNumFound());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
index 894f26d..a4fbba1 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java
@@ -179,7 +179,7 @@ public class ReplicationFactorTest extends AbstractFullDistribZkTestBase {
     ZkCoreNodeProps zkProps = new ZkCoreNodeProps(replica);
     String url = zkProps.getBaseUrl() + "/" + collection;
 
-    try (HttpSolrClient solrServer = new HttpSolrClient(url)) {
+    try (HttpSolrClient solrServer = getHttpSolrClient(url)) {
       NamedList resp = solrServer.request(up);
       NamedList hdr = (NamedList) resp.get("responseHeader");
       Integer batchRf = (Integer)hdr.get(UpdateRequest.REPFACT);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java b/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
index a0bb08f..8a72adb 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SSLMigrationTest.java
@@ -130,7 +130,7 @@ public class SSLMigrationTest extends AbstractFullDistribZkTestBase {
       urls.add(replica.getStr(ZkStateReader.BASE_URL_PROP));
     }
     //Create new SolrServer to configure new HttpClient w/ SSL config
-    new LBHttpSolrClient(urls.toArray(new String[]{})).request(request);
+    getLBHttpSolrClient(urls.toArray(new String[]{})).request(request);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java b/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
index 6d4b9cc..21dc257 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
@@ -16,6 +16,16 @@
  */
 package org.apache.solr.cloud;
 
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.client.solrj.SolrClient;
@@ -44,16 +54,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
 import static org.apache.solr.cloud.OverseerCollectionMessageHandler.NUM_SLICES;
 import static org.apache.solr.common.cloud.ZkStateReader.MAX_SHARDS_PER_NODE;
 import static org.apache.solr.common.cloud.ZkStateReader.REPLICATION_FACTOR;
@@ -274,7 +274,7 @@ public class ShardSplitTest extends BasicDistributedZkTest {
 
     String url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), collectionName);
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
 
       ClusterState clusterState = cloudClient.getZkStateReader().getClusterState();
       final DocRouter router = clusterState.getCollection(collectionName).getRouter();
@@ -348,7 +348,7 @@ public class ShardSplitTest extends BasicDistributedZkTest {
 
     String url = getUrlFromZk(getCommonCloudSolrClient().getZkStateReader().getClusterState(), collectionName);
 
-    try (HttpSolrClient collectionClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(url)) {
 
       String splitKey = "b!";
 
@@ -445,7 +445,7 @@ public class ShardSplitTest extends BasicDistributedZkTest {
 
     ZkCoreNodeProps shard1_0 = getLeaderUrlFromZk(AbstractDistribZkTestBase.DEFAULT_COLLECTION, SHARD1_0);
     QueryResponse response;
-    try (HttpSolrClient shard1_0Client = new HttpSolrClient(shard1_0.getCoreUrl())) {
+    try (HttpSolrClient shard1_0Client = getHttpSolrClient(shard1_0.getCoreUrl())) {
       response = shard1_0Client.query(query);
     }
     long shard10Count = response.getResults().getNumFound();
@@ -453,7 +453,7 @@ public class ShardSplitTest extends BasicDistributedZkTest {
     ZkCoreNodeProps shard1_1 = getLeaderUrlFromZk(
         AbstractDistribZkTestBase.DEFAULT_COLLECTION, SHARD1_1);
     QueryResponse response2;
-    try (HttpSolrClient shard1_1Client = new HttpSolrClient(shard1_1.getCoreUrl())) {
+    try (HttpSolrClient shard1_1Client = getHttpSolrClient(shard1_1.getCoreUrl())) {
       response2 = shard1_1Client.query(query);
     }
     long shard11Count = response2.getResults().getNumFound();
@@ -475,7 +475,7 @@ public class ShardSplitTest extends BasicDistributedZkTest {
     for (Replica replica : slice.getReplicas()) {
       String coreUrl = new ZkCoreNodeProps(replica).getCoreUrl();
       QueryResponse response;
-      try (HttpSolrClient client = new HttpSolrClient(coreUrl)) {
+      try (HttpSolrClient client = getHttpSolrClient(coreUrl)) {
         response = client.query(query);
       }
       numFound[c++] = response.getResults().getNumFound();
@@ -514,7 +514,7 @@ public class ShardSplitTest extends BasicDistributedZkTest {
         .getBaseURL();
     baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length());
 
-    try (HttpSolrClient baseServer = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient baseServer = getHttpSolrClient(baseUrl)) {
       baseServer.setConnectionTimeout(30000);
       baseServer.setSoTimeout(60000 * 5);
       baseServer.request(request);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java
index 362009e..beda3e9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java
@@ -110,7 +110,7 @@ public class SyncSliceTest extends AbstractFullDistribZkTestBase {
         .getBaseURL();
     baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length());
     
-    try (HttpSolrClient baseClient = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient baseClient = getHttpSolrClient(baseUrl)) {
       // we only set the connect timeout, not so timeout
       baseClient.setConnectionTimeout(30000);
       baseClient.request(request);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
index 2781896..987f2f1 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
@@ -145,17 +145,17 @@ public class TestCloudDeleteByQuery extends SolrCloudTestCase {
       assertNotNull("could not find URL for " + shardName + " replica", passiveUrl);
 
       if (shardName.equals("shard1")) {
-        S_ONE_LEADER_CLIENT = new HttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
-        S_ONE_NON_LEADER_CLIENT = new HttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
+        S_ONE_LEADER_CLIENT = getHttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
+        S_ONE_NON_LEADER_CLIENT = getHttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
       } else if (shardName.equals("shard2")) {
-        S_TWO_LEADER_CLIENT = new HttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
-        S_TWO_NON_LEADER_CLIENT = new HttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
+        S_TWO_LEADER_CLIENT = getHttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
+        S_TWO_NON_LEADER_CLIENT = getHttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
       } else {
         fail("unexpected shard: " + shardName);
       }
     }
     assertEquals("Should be exactly one server left (nost hosting either shard)", 1, urlMap.size());
-    NO_COLLECTION_CLIENT = new HttpSolrClient(urlMap.values().iterator().next() +
+    NO_COLLECTION_CLIENT = getHttpSolrClient(urlMap.values().iterator().next() +
                                               "/" + COLLECTION_NAME + "/");
     
     assertNotNull(S_ONE_LEADER_CLIENT);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
index b505930..c804329 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
@@ -79,8 +79,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   @Test
   public void testCreateErrors() throws Exception {
-    final SolrClient solrClient =
-        new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+    final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+    final SolrClient solrClient = getHttpSolrClient(baseUrl);
     final File configDir = getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
     solrCluster.uploadConfigDir(configDir, "configSet");
 
@@ -143,8 +143,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   private void verifyCreate(String baseConfigSetName, String configSetName,
       Map<String, String> oldProps, Map<String, String> newProps) throws Exception {
-    final SolrClient solrClient =
-        new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+    final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+    final SolrClient solrClient = getHttpSolrClient(baseUrl);
     setupBaseConfigSet(baseConfigSetName, oldProps);
 
     SolrZkClient zkClient = new SolrZkClient(solrCluster.getZkServer().getZkAddress(),
@@ -235,8 +235,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   @Test
   public void testDeleteErrors() throws Exception {
-    final SolrClient solrClient =
-        new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+    final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+    final SolrClient solrClient = getHttpSolrClient(baseUrl);
     final File configDir = getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
     final File tmpConfigDir = createTempDir().toFile();
     tmpConfigDir.deleteOnExit();
@@ -274,8 +274,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   @Test
   public void testDelete() throws Exception {
-    final SolrClient solrClient =
-        new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+    final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+    final SolrClient solrClient = getHttpSolrClient(baseUrl);
     final File configDir = getFile("solr").toPath().resolve("configsets/configset-2/conf").toFile();
     final String configSet = "configSet";
     solrCluster.uploadConfigDir(configDir, configSet);
@@ -300,8 +300,8 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
 
   @Test
   public void testList() throws Exception {
-    final SolrClient solrClient =
-        new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+    final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+    final SolrClient solrClient = getHttpSolrClient(baseUrl);
 
     SolrZkClient zkClient = new SolrZkClient(solrCluster.getZkServer().getZkAddress(),
         AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
index 2d2aa58..c5a0bc5 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java
@@ -121,8 +121,8 @@ public class TestConfigSetsAPIExclusivity extends SolrTestCaseJ4 {
     public abstract ConfigSetAdminRequest createRequest();
 
     public void run() {
-      final SolrClient solrClient =
-          new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+      final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+      final SolrClient solrClient = getHttpSolrClient(baseUrl);
       ConfigSetAdminRequest request = createRequest();
 
       for (int i = 0; i < trials; ++i) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
index 9e5989a..458d68a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java
@@ -99,8 +99,8 @@ public class TestConfigSetsAPIZkFailure extends SolrTestCaseJ4 {
 
   @Test
   public void testCreateZkFailure() throws Exception {
-    final SolrClient solrClient =
-        new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString());
+    final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString();
+    final SolrClient solrClient = getHttpSolrClient(baseUrl);
 
     final Map<String, String> oldProps = ImmutableMap.of("immutable", "true");
     setupBaseConfigSet(BASE_CONFIGSET_NAME, oldProps);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java b/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java
index cdbc170..a8e2063 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java
@@ -119,7 +119,7 @@ public class TestCryptoKeys extends AbstractFullDistribZkTestBase {
     String baseURL = randomClient.getBaseURL();
     baseURL = baseURL.substring(0, baseURL.lastIndexOf('/'));
 
-    TestBlobHandler.createSystemCollection(new HttpSolrClient(baseURL, randomClient.getHttpClient()));
+    TestBlobHandler.createSystemCollection(getHttpSolrClient(baseURL, randomClient.getHttpClient()));
     waitForRecoveriesToFinish(".system", true);
 
     ByteBuffer jar = TestDynamicLoading.getFileContent("runtimecode/runtimelibs.jar.bin");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
index bc4352f..b82ba74 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java
@@ -74,7 +74,7 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
   private void sendRequestToEachServer() throws Exception {
     List<JettySolrRunner> jettys = miniCluster.getJettySolrRunners();
     for (JettySolrRunner jetty : jettys) {
-      try (HttpSolrClient client = new HttpSolrClient(jetty.getBaseUrl().toString())) {
+      try (HttpSolrClient client = getHttpSolrClient(jetty.getBaseUrl().toString())) {
         CoreAdminRequest req = new CoreAdminRequest();
         req.setAction( CoreAdminAction.STATUS );
         client.request(req);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestRandomRequestDistribution.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRandomRequestDistribution.java b/solr/core/src/test/org/apache/solr/cloud/TestRandomRequestDistribution.java
index 256774d..f130944 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestRandomRequestDistribution.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestRandomRequestDistribution.java
@@ -96,7 +96,7 @@ public class TestRandomRequestDistribution extends AbstractFullDistribZkTestBase
     assertEquals(1, replicas.size());
     String baseUrl = replicas.iterator().next().getStr(ZkStateReader.BASE_URL_PROP);
     if (!baseUrl.endsWith("/")) baseUrl += "/";
-    HttpSolrClient client = new HttpSolrClient(baseUrl + "a1x2");
+    HttpSolrClient client = getHttpSolrClient(baseUrl + "a1x2");
     client.setSoTimeout(5000);
     client.setConnectionTimeout(2000);
 
@@ -173,7 +173,7 @@ public class TestRandomRequestDistribution extends AbstractFullDistribZkTestBase
     if (!baseUrl.endsWith("/")) baseUrl += "/";
     String path = baseUrl + "football";
     log.info("Firing queries against path=" + path);
-    HttpSolrClient client = new HttpSolrClient(path);
+    HttpSolrClient client = getHttpSolrClient(path);
     client.setSoTimeout(5000);
     client.setConnectionTimeout(2000);
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java
index 485558f..d8b66e9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestRequestStatusCollectionAPI.java
@@ -189,7 +189,7 @@ public class TestRequestStatusCollectionAPI extends BasicDistributedZkTest {
     String baseUrl = ((HttpSolrClient) shardToJetty.get(SHARD1).get(0).client.solrClient).getBaseURL();
     baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length());
 
-    try (HttpSolrClient baseServer = new HttpSolrClient(baseUrl)) {
+    try (HttpSolrClient baseServer = getHttpSolrClient(baseUrl)) {
       baseServer.setConnectionTimeout(15000);
       return baseServer.request(request);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
index 054c074..9e5e68b 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
@@ -162,17 +162,17 @@ public class TestTolerantUpdateProcessorCloud extends SolrCloudTestCase {
       assertNotNull("could not find URL for " + shardName + " replica", passiveUrl);
 
       if (shardName.equals("shard1")) {
-        S_ONE_LEADER_CLIENT = new HttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
-        S_ONE_NON_LEADER_CLIENT = new HttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
+        S_ONE_LEADER_CLIENT = getHttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
+        S_ONE_NON_LEADER_CLIENT = getHttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
       } else if (shardName.equals("shard2")) {
-        S_TWO_LEADER_CLIENT = new HttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
-        S_TWO_NON_LEADER_CLIENT = new HttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
+        S_TWO_LEADER_CLIENT = getHttpSolrClient(leaderUrl + "/" + COLLECTION_NAME + "/");
+        S_TWO_NON_LEADER_CLIENT = getHttpSolrClient(passiveUrl + "/" + COLLECTION_NAME + "/");
       } else {
         fail("unexpected shard: " + shardName);
       }
     }
     assertEquals("Should be exactly one server left (nost hosting either shard)", 1, urlMap.size());
-    NO_COLLECTION_CLIENT = new HttpSolrClient(urlMap.values().iterator().next() +
+    NO_COLLECTION_CLIENT = getHttpSolrClient(urlMap.values().iterator().next() +
                                               "/" + COLLECTION_NAME + "/");
     
     assertNotNull(S_ONE_LEADER_CLIENT);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
index b3f0423..08ab4c0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
@@ -127,7 +127,7 @@ public class TestTolerantUpdateProcessorRandomCloud extends SolrCloudTestCase {
     
     for (JettySolrRunner jetty : cluster.getJettySolrRunners()) {
       URL jettyURL = jetty.getBaseUrl();
-      NODE_CLIENTS.add(new HttpSolrClient(jettyURL.toString() + "/" + COLLECTION_NAME + "/"));
+      NODE_CLIENTS.add(getHttpSolrClient(jettyURL.toString() + "/" + COLLECTION_NAME + "/"));
     }
     assertEquals(numServers, NODE_CLIENTS.size());
     

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java
index 7d53fee..616cd37 100644
--- a/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java
@@ -123,7 +123,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     SolrClient client = clients.get(0);
     String url1 = getBaseUrl(client);
 
-    try (HttpSolrClient adminClient = new HttpSolrClient(url1)) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url1)) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(60000);
       adminClient.request(createCmd);
@@ -174,7 +174,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     // create a new collection collection
     SolrClient client = clients.get(0);
     String url1 = getBaseUrl(client);
-    try (HttpSolrClient adminClient = new HttpSolrClient(url1)) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url1)) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(60000);
 
@@ -194,7 +194,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     
     client = clients.get(1);
     String url2 = getBaseUrl(client);
-    try (HttpSolrClient adminClient = new HttpSolrClient(url2)) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url2)) {
 
       Create createCmd = new Create();
       createCmd.setCoreName("unloadcollection2");
@@ -213,7 +213,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     
     Random random = random();
     if (random.nextBoolean()) {
-      try (HttpSolrClient collectionClient = new HttpSolrClient(leaderProps.getCoreUrl())) {
+      try (HttpSolrClient collectionClient = getHttpSolrClient(leaderProps.getCoreUrl())) {
         // lets try and use the solrj client to index and retrieve a couple
         // documents
         SolrInputDocument doc1 = getDoc(id, 6, i1, -600, tlong, 600, t1,
@@ -232,7 +232,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     // create another replica for our collection
     client = clients.get(2);
     String url3 = getBaseUrl(client);
-    try (HttpSolrClient adminClient = new HttpSolrClient(url3)) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url3)) {
       Create createCmd = new Create();
       createCmd.setCoreName("unloadcollection3");
       createCmd.setCollection("unloadcollection");
@@ -246,7 +246,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     // so that we start with some versions when we reload...
     DirectUpdateHandler2.commitOnClose = false;
     
-    try (HttpSolrClient addClient = new HttpSolrClient(url3 + "/unloadcollection3")) {
+    try (HttpSolrClient addClient = getHttpSolrClient(url3 + "/unloadcollection3")) {
       addClient.setConnectionTimeout(30000);
 
       // add a few docs
@@ -260,7 +260,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     //collectionClient.commit();
     
     // unload the leader
-    try (HttpSolrClient collectionClient = new HttpSolrClient(leaderProps.getBaseUrl())) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(leaderProps.getBaseUrl())) {
       collectionClient.setConnectionTimeout(15000);
       collectionClient.setSoTimeout(30000);
 
@@ -284,7 +284,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     // ensure there is a leader
     zkStateReader.getLeaderRetry("unloadcollection", "shard1", 15000);
     
-    try (HttpSolrClient addClient = new HttpSolrClient(url2 + "/unloadcollection2")) {
+    try (HttpSolrClient addClient = getHttpSolrClient(url2 + "/unloadcollection2")) {
       addClient.setConnectionTimeout(30000);
       addClient.setSoTimeout(90000);
 
@@ -299,7 +299,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     // create another replica for our collection
     client = clients.get(3);
     String url4 = getBaseUrl(client);
-    try (HttpSolrClient adminClient = new HttpSolrClient(url4)) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url4)) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(30000);
 
@@ -314,7 +314,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     
     // unload the leader again
     leaderProps = getLeaderUrlFromZk("unloadcollection", "shard1");
-    try (HttpSolrClient collectionClient = new HttpSolrClient(leaderProps.getBaseUrl())) {
+    try (HttpSolrClient collectionClient = getHttpSolrClient(leaderProps.getBaseUrl())) {
       collectionClient.setConnectionTimeout(15000);
       collectionClient.setSoTimeout(30000);
 
@@ -338,7 +338,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
     DirectUpdateHandler2.commitOnClose = true;
     
     // bring the downed leader back as replica
-    try (HttpSolrClient adminClient = new HttpSolrClient(leaderProps.getBaseUrl())) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(leaderProps.getBaseUrl())) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(30000);
 
@@ -352,7 +352,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
 
     long found1, found3;
     
-    try (HttpSolrClient adminClient = new HttpSolrClient(url2 + "/unloadcollection")) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url2 + "/unloadcollection")) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(30000);
       adminClient.commit();
@@ -360,7 +360,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
       q.set("distrib", false);
       found1 = adminClient.query(q).getResults().getNumFound();
     }
-    try (HttpSolrClient adminClient = new HttpSolrClient(url3 + "/unloadcollection")) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url3 + "/unloadcollection")) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(30000);
       adminClient.commit();
@@ -369,7 +369,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
       found3 = adminClient.query(q).getResults().getNumFound();
     }
 
-    try (HttpSolrClient adminClient = new HttpSolrClient(url4 + "/unloadcollection")) {
+    try (HttpSolrClient adminClient = getHttpSolrClient(url4 + "/unloadcollection")) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(30000);
       adminClient.commit();
@@ -387,7 +387,7 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
   private void testUnloadLotsOfCores() throws Exception {
     SolrClient client = clients.get(2);
     String url3 = getBaseUrl(client);
-    try (final HttpSolrClient adminClient = new HttpSolrClient(url3)) {
+    try (final HttpSolrClient adminClient = getHttpSolrClient(url3)) {
       adminClient.setConnectionTimeout(15000);
       adminClient.setSoTimeout(60000);
       int cnt = atLeast(3);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsWriteToMultipleCollectionsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsWriteToMultipleCollectionsTest.java b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsWriteToMultipleCollectionsTest.java
index 5faa065..ddf6e51 100644
--- a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsWriteToMultipleCollectionsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsWriteToMultipleCollectionsTest.java
@@ -97,7 +97,7 @@ public class HdfsWriteToMultipleCollectionsTest extends BasicDistributedZkTest {
     List<CloudSolrClient> cloudClients = new ArrayList<>();
     List<StoppableIndexingThread> threads = new ArrayList<>();
     for (int i = 0; i < cnt; i++) {
-      CloudSolrClient client = new CloudSolrClient(zkServer.getZkAddress());
+      CloudSolrClient client = getCloudSolrClient(zkServer.getZkAddress());
       client.setDefaultCollection(ACOLLECTION + i);
       cloudClients.add(client);
       StoppableIndexingThread indexThread = new StoppableIndexingThread(null, client, "1", true, docCount, 1, true);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java b/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java
index 601f4fe..aeb4cb7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java
@@ -165,7 +165,7 @@ public class StressHdfsTest extends BasicDistributedZkTest {
     
     int i = 0;
     for (SolrClient client : clients) {
-      try (HttpSolrClient c = new HttpSolrClient(getBaseUrl(client) + "/" + DELETE_DATA_DIR_COLLECTION)) {
+      try (HttpSolrClient c = getHttpSolrClient(getBaseUrl(client) + "/" + DELETE_DATA_DIR_COLLECTION)) {
         int docCnt = random().nextInt(1000) + 1;
         for (int j = 0; j < docCnt; j++) {
           c.add(getDoc("id", i++, "txt_t", "just some random text for a doc"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java b/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java
index 7875b7c..1c9cbee 100644
--- a/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java
+++ b/solr/core/src/test/org/apache/solr/core/OpenCloseCoreStressTest.java
@@ -148,14 +148,14 @@ public class OpenCloseCoreStressTest extends SolrTestCaseJ4 {
     // Mostly to keep annoying logging messages from being sent out all the time.
 
     for (int idx = 0; idx < indexingThreads; ++idx) {
-      HttpSolrClient client = new HttpSolrClient(url);
+      HttpSolrClient client = getHttpSolrClient(url);
       client.setDefaultMaxConnectionsPerHost(25);
       client.setConnectionTimeout(30000);
       client.setSoTimeout(60000);
       indexingClients.add(client);
     }
     for (int idx = 0; idx < queryThreads; ++idx) {
-      HttpSolrClient client = new HttpSolrClient(url);
+      HttpSolrClient client = getHttpSolrClient(url);
       client.setDefaultMaxConnectionsPerHost(25);
       client.setConnectionTimeout(30000);
       client.setSoTimeout(30000);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java b/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java
index c8b4630..63afe6c 100644
--- a/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java
+++ b/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java
@@ -112,7 +112,7 @@ public class TestDynamicLoading extends AbstractFullDistribZkTestBase {
     assertEquals(TestBlobHandler.getAsString(map), ".system collection not available", map.get("msg"));
 
 
-    TestBlobHandler.createSystemCollection(new HttpSolrClient(baseURL, randomClient.getHttpClient()));
+    TestBlobHandler.createSystemCollection(getHttpSolrClient(baseURL, randomClient.getHttpClient()));
     waitForRecoveriesToFinish(".system", true);
 
     map = TestSolrConfigHandler.getRespMap("/test1?wt=json", client);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
index eab3e87..ec5280c 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
@@ -156,7 +156,8 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
   private static SolrClient createNewSolrClient(int port) {
     try {
       // setup the client...
-      HttpSolrClient client = new HttpSolrClient(buildUrl(port) + "/" + DEFAULT_TEST_CORENAME);
+      final String baseUrl = buildUrl(port) + "/" + DEFAULT_TEST_CORENAME;
+      HttpSolrClient client = getHttpSolrClient(baseUrl);
       client.setConnectionTimeout(15000);
       client.setSoTimeout(60000);
       client.setDefaultMaxConnectionsPerHost(100);
@@ -277,7 +278,7 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
 
   private HttpSolrClient adminClient(SolrClient client) {
     String adminUrl = ((HttpSolrClient)client).getBaseURL().replace("/collection1", "");
-    return new HttpSolrClient(adminUrl);
+    return getHttpSolrClient(adminUrl);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java
index 29c0dd7..3ef6259 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java
@@ -79,7 +79,8 @@ public class TestReplicationHandlerBackup extends SolrJettyTestBase {
   private static SolrClient createNewSolrClient(int port) {
     try {
       // setup the client...
-      HttpSolrClient client = new HttpSolrClient(buildUrl(port, context) + "/" + DEFAULT_TEST_CORENAME);
+      final String baseUrl = buildUrl(port, context) + "/" + DEFAULT_TEST_CORENAME;
+      HttpSolrClient client = getHttpSolrClient(baseUrl);
       client.setConnectionTimeout(15000);
       client.setSoTimeout(60000);
       client.setDefaultMaxConnectionsPerHost(100);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
index 1218783..a39a57e 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
@@ -72,7 +72,8 @@ public class TestRestoreCore extends SolrJettyTestBase {
   private static SolrClient createNewSolrClient(int port) {
     try {
       // setup the client...
-      HttpSolrClient client = new HttpSolrClient(buildUrl(port, context) + "/" + DEFAULT_TEST_CORENAME);
+      final String baseUrl = buildUrl(port, context) + "/" + DEFAULT_TEST_CORENAME;
+      HttpSolrClient client = getHttpSolrClient(baseUrl);
       client.setConnectionTimeout(15000);
       client.setSoTimeout(60000);
       client.setDefaultMaxConnectionsPerHost(100);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
index 89f4b2b..3d4a51d 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java
@@ -254,7 +254,7 @@ public class CoreAdminHandlerTest extends SolrTestCaseJ4 {
     JettySolrRunner runner = new JettySolrRunner(solrHomeDirectory.getAbsolutePath(), buildJettyConfig("/solr"));
     runner.start();
 
-    try (HttpSolrClient client = new HttpSolrClient(runner.getBaseUrl() + "/corex")) {
+    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl() + "/corex")) {
       client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
       client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
       SolrInputDocument doc = new SolrInputDocument();
@@ -263,7 +263,7 @@ public class CoreAdminHandlerTest extends SolrTestCaseJ4 {
       client.commit();
     }
 
-    try (HttpSolrClient client = new HttpSolrClient(runner.getBaseUrl().toString())) {
+    try (HttpSolrClient client = getHttpSolrClient(runner.getBaseUrl().toString())) {
       client.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
       client.setSoTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT);
       CoreAdminRequest.Unload req = new CoreAdminRequest.Unload(false);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
index 16a3e87..b447668 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
@@ -67,8 +67,8 @@ public class DistributedDebugComponentTest extends SolrJettyTestBase {
     createJetty(solrHome.getAbsolutePath());
     String url = jetty.getBaseUrl().toString();
 
-    collection1 = new HttpSolrClient(url + "/collection1");
-    collection2 = new HttpSolrClient(url + "/collection2");
+    collection1 = getHttpSolrClient(url + "/collection1");
+    collection2 = getHttpSolrClient(url + "/collection2");
     
     String urlCollection1 = jetty.getBaseUrl().toString() + "/" + "collection1";
     String urlCollection2 = jetty.getBaseUrl().toString() + "/" + "collection2";
@@ -76,7 +76,7 @@ public class DistributedDebugComponentTest extends SolrJettyTestBase {
     shard2 = urlCollection2.replaceAll("https?://", "");
     
     //create second core
-    try (HttpSolrClient nodeClient = new HttpSolrClient(url)) {
+    try (HttpSolrClient nodeClient = getHttpSolrClient(url)) {
       CoreAdminRequest.Create req = new CoreAdminRequest.Create();
       req.setCoreName("collection2");
       req.setConfigSet("collection1");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
index 0c18b25..960021e 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
@@ -109,7 +109,8 @@ public class DistributedQueryElevationComponentTest extends BaseDistributedSearc
     assertEquals(true, document.getFieldValue("[elevated]"));
 
     // Force javabin format
-    HttpSolrClient client = new HttpSolrClient(((HttpSolrClient)clients.get(0)).getBaseURL());
+    final String clientUrl = ((HttpSolrClient)clients.get(0)).getBaseURL();
+    HttpSolrClient client = getHttpSolrClient(clientUrl);
     client.setParser(new BinaryResponseParser());
     SolrQuery solrQuery = new SolrQuery("XXXX").setParam("qt", "/elevate").setParam("shards.qt", "/elevate").setRows(500).setFields("id,[elevated]")
         .setParam("enableElevation", "true").setParam("forceElevation", "true").setParam("elevateIds", "6", "wt", "javabin")

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrJ.java b/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
index b70205e..1fd485f 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrJ.java
@@ -59,7 +59,7 @@ public class TestSolrJ extends SolrTestCaseJ4 {
     ConcurrentUpdateSolrClient concurrentClient = null;
 
     // server = concurrentClient = new ConcurrentUpdateSolrServer(addr,32,8);
-    client = concurrentClient = new ConcurrentUpdateSolrClient(addr,64,nConnections);
+    client = concurrentClient = getConcurrentUpdateSolrClient(addr,64,nConnections);
 
     client.deleteByQuery("*:*");
     client.commit();
@@ -164,7 +164,7 @@ public class TestSolrJ extends SolrTestCaseJ4 {
 
   public void doCommitPerf() throws Exception {
 
-    try (HttpSolrClient client = new HttpSolrClient("http://127.0.0.1:8983/solr")) {
+    try (HttpSolrClient client = getHttpSolrClient("http://127.0.0.1:8983/solr")) {
 
       final RTimer timer = new RTimer();
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
index 9bb4d21..f1b64bc 100644
--- a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
+++ b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
@@ -117,8 +117,8 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
 
     //Test against all nodes
     for (JettySolrRunner jettySolrRunner : solrCluster.getJettySolrRunners()) {
-      SolrClient solrClient = new HttpSolrClient(jettySolrRunner.getBaseUrl().toString());
-      SolrClient solrClient_local = new HttpSolrClient(jettySolrRunner.getBaseUrl().toString());
+      SolrClient solrClient = getHttpSolrClient(jettySolrRunner.getBaseUrl().toString());
+      SolrClient solrClient_local = getHttpSolrClient(jettySolrRunner.getBaseUrl().toString());
 
       SolrQuery query = new SolrQuery("cat:football");
       query.setFields("*,score");
@@ -161,8 +161,8 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
 
     //Test against all nodes
     for (JettySolrRunner jettySolrRunner : solrCluster.getJettySolrRunners()) {
-      SolrClient solrClient = new HttpSolrClient(jettySolrRunner.getBaseUrl().toString());
-      SolrClient solrClient_local = new HttpSolrClient(jettySolrRunner.getBaseUrl().toString());
+      SolrClient solrClient = getHttpSolrClient(jettySolrRunner.getBaseUrl().toString());
+      SolrClient solrClient_local = getHttpSolrClient(jettySolrRunner.getBaseUrl().toString());
 
       SolrQuery query = new SolrQuery("cat:football");
       query.setFields("*,score").add("collection", "collection1,collection2");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
index 96a8c14..d24ef3e 100644
--- a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
@@ -59,6 +59,7 @@ import org.slf4j.LoggerFactory;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.Collections.singletonMap;
+import static org.apache.solr.SolrTestCaseJ4.getHttpSolrClient;
 import static org.apache.solr.common.cloud.ZkStateReader.BASE_URL_PROP;
 
 
@@ -162,7 +163,7 @@ public class BasicAuthIntegrationTest extends TestMiniSolrCloudClusterBase {
     CollectionAdminRequest.Reload reload = new CollectionAdminRequest.Reload();
     reload.setCollectionName(defaultCollName);
 
-    HttpSolrClient solrClient = new HttpSolrClient(baseUrl);
+    HttpSolrClient solrClient = getHttpSolrClient(baseUrl);
     try {
       rsp = solrClient.request(reload);
       fail("must have failed");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java b/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java
index 85f2190..d3304f4 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java
@@ -78,7 +78,8 @@ public class TestNamedUpdateProcessors extends AbstractFullDistribZkTestBase {
     HttpSolrClient randomClient = (HttpSolrClient) clients.get(random().nextInt(clients.size()));
     String baseURL = randomClient.getBaseURL();
 
-    TestBlobHandler.createSystemCollection(new HttpSolrClient(baseURL.substring(0, baseURL.lastIndexOf('/')), randomClient.getHttpClient()));
+    final String solrClientUrl = baseURL.substring(0, baseURL.lastIndexOf('/'));
+    TestBlobHandler.createSystemCollection(getHttpSolrClient(solrClientUrl, randomClient.getHttpClient()));
     waitForRecoveriesToFinish(".system", true);
 
     TestBlobHandler.postAndCheck(cloudClient, baseURL.substring(0, baseURL.lastIndexOf('/')), blobName, TestDynamicLoading.generateZip(RuntimeUrp.class), 1);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
index 1a07d31..28a58ff 100644
--- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
+++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
@@ -351,7 +351,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
         exampleSolrHomeDir.isDirectory());
 
     if ("techproducts".equals(exampleName)) {
-      HttpSolrClient solrClient = new HttpSolrClient("http://localhost:" + bindPort + "/solr/" + exampleName);
+      HttpSolrClient solrClient = getHttpSolrClient("http://localhost:" + bindPort + "/solr/" + exampleName);
       SolrQuery query = new SolrQuery("*:*");
       QueryResponse qr = solrClient.query(query);
       long numFound = qr.getResults().getNumFound();
@@ -439,7 +439,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
     CloudSolrClient cloudClient = null;
 
     try {
-      cloudClient = new CloudSolrClient(executor.solrCloudCluster.getZkServer().getZkAddress());
+      cloudClient = getCloudSolrClient(executor.solrCloudCluster.getZkServer().getZkAddress());
       cloudClient.connect();
       cloudClient.setDefaultCollection(collectionName);
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
index 4ad3726..bd1dd2c 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
@@ -32,7 +32,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 import java.util.Set;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -191,12 +190,17 @@ public class CloudSolrClient extends SolrClient {
    *          "host1:2181,host2:2181,host3:2181/mysolrchroot"
    *          <p>
    *          "zoo1.example.com:2181,zoo2.example.com:2181,zoo3.example.com:2181"
+   *          
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(String zkHost) {
       this.zkHost = zkHost;
       this.clientIsInternal = true;
       this.myClient = HttpClientUtil.createClient(null);
-      this.lbClient = new LBHttpSolrClient(myClient);
+      this.lbClient = new LBHttpSolrClient.Builder()
+          .withHttpClient(myClient)
+          .build();
       this.lbClient.setRequestWriter(new BinaryRequestWriter());
       this.lbClient.setParser(new BinaryResponseParser());
       this.updatesToLeaders = true;
@@ -226,14 +230,15 @@ public class CloudSolrClient extends SolrClient {
    * @param httpClient
    *          the {@link HttpClient} instance to be used for all requests. The
    *          provided httpClient should use a multi-threaded connection manager.
+   *          
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(String zkHost, HttpClient httpClient)  {
     this.zkHost = zkHost;
     this.clientIsInternal = httpClient == null;
     this.myClient = httpClient == null ? HttpClientUtil.createClient(null) : httpClient;
-    this.lbClient = new LBHttpSolrClient(myClient);
-    this.lbClient.setRequestWriter(new BinaryRequestWriter());
-    this.lbClient.setParser(new BinaryResponseParser());
+    this.lbClient = createLBHttpSolrClient(myClient);
     this.updatesToLeaders = true;
     shutdownLBHttpSolrServer = true;
     lbClient.addQueryParams(STATE_VERSION);
@@ -256,7 +261,9 @@ public class CloudSolrClient extends SolrClient {
    * @throws IllegalArgumentException
    *           if the chroot value does not start with a forward slash.
    * @see #CloudSolrClient(String)
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(Collection<String> zkHosts, String chroot) {
     this(zkHosts, chroot, null);
   }
@@ -281,47 +288,64 @@ public class CloudSolrClient extends SolrClient {
    * @throws IllegalArgumentException
    *           if the chroot value does not start with a forward slash.
    * @see #CloudSolrClient(String)
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(Collection<String> zkHosts, String chroot, HttpClient httpClient) {
-    StringBuilder zkBuilder = new StringBuilder();
-    int lastIndexValue = zkHosts.size() - 1;
-    int i = 0;
-    for (String zkHost : zkHosts) {
-      zkBuilder.append(zkHost);
-      if (i < lastIndexValue) {
-        zkBuilder.append(",");
-      }
-      i++;
-    }
-    if (chroot != null) {
-      if (chroot.startsWith("/")) {
-        zkBuilder.append(chroot);
-      } else {
-        throw new IllegalArgumentException(
-            "The chroot must start with a forward slash.");
-      }
-    }
-
-    /* Log the constructed connection string and then initialize. */
-    log.info("Final constructed zkHost string: " + zkBuilder.toString());
-
-    this.zkHost = zkBuilder.toString();
+    this.zkHost = buildZkHostString(zkHosts, chroot);
     this.clientIsInternal = httpClient == null;
     this.myClient = httpClient == null ? HttpClientUtil.createClient(null) : httpClient;
-    this.lbClient = new LBHttpSolrClient(myClient);
-    this.lbClient.setRequestWriter(new BinaryRequestWriter());
-    this.lbClient.setParser(new BinaryResponseParser());
+    this.lbClient = createLBHttpSolrClient(myClient);
     this.updatesToLeaders = true;
     shutdownLBHttpSolrServer = true;
   }
   
   /**
+   * Create a new client object that connects to Zookeeper and is always aware
+   * of the SolrCloud state. If there is a fully redundant Zookeeper quorum and
+   * SolrCloud has enough replicas for every shard in a collection, there is no
+   * single point of failure. Updates will be sent to shard leaders by default.
+   * 
+   * @param zkHosts
+   *          A Java Collection (List, Set, etc) of HOST:PORT strings, one for
+   *          each host in the zookeeper ensemble. Note that with certain
+   *          Collection types like HashSet, the order of hosts in the final
+   *          connect string may not be in the same order you added them.
+   * @param chroot
+   *          A chroot value for zookeeper, starting with a forward slash. If no
+   *          chroot is required, use null.
+   * @param httpClient
+   *          the {@link HttpClient} instance to be used for all requests. The provided httpClient should use a
+   *          multi-threaded connection manager.  If null, a default HttpClient will be used.
+   * @param lbSolrClient
+   *          LBHttpSolrServer instance for requests.  If null, a default HttpClient will be used.
+   * @param updatesToLeaders
+   *          If true, sends updates to shard leaders.
+   *
+   * @deprecated use {@link Builder} instead.  This will soon be a protected method, and will only
+   * be available for use in implementing subclasses.
+   */
+  @Deprecated
+  public CloudSolrClient(Collection<String> zkHosts, String chroot, HttpClient httpClient, LBHttpSolrClient lbSolrClient, boolean updatesToLeaders) {
+    this.zkHost = buildZkHostString(zkHosts, chroot);
+    this.updatesToLeaders = updatesToLeaders;
+    
+    this.clientIsInternal = httpClient == null;
+    this.myClient = httpClient == null ? HttpClientUtil.createClient(null) : httpClient;
+    
+    this.shutdownLBHttpSolrServer = lbSolrClient == null;
+    this.lbClient = lbSolrClient == null ? createLBHttpSolrClient(myClient) : lbSolrClient;
+  }
+  
+  /**
    * @param zkHost
    *          A zookeeper client endpoint.
    * @param updatesToLeaders
    *          If true, sends updates only to shard leaders.
    * @see #CloudSolrClient(String) for full description and details on zkHost
+   * @deprecated use {@link CloudSolrClient.Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(String zkHost, boolean updatesToLeaders) {
     this(zkHost, updatesToLeaders, null);
   }
@@ -335,12 +359,16 @@ public class CloudSolrClient extends SolrClient {
    *          the {@link HttpClient} instance to be used for all requests. The provided httpClient should use a
    *          multi-threaded connection manager.
    * @see #CloudSolrClient(String) for full description and details on zkHost
+   * @deprecated use {@link CloudSolrClient.Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(String zkHost, boolean updatesToLeaders, HttpClient httpClient) {
     this.zkHost = zkHost;
     this.clientIsInternal = httpClient == null;
     this.myClient = httpClient == null ? HttpClientUtil.createClient(null) : httpClient;
-    this.lbClient = new LBHttpSolrClient(myClient);
+    this.lbClient = new LBHttpSolrClient.Builder()
+        .withHttpClient(myClient)
+        .build();
     this.lbClient.setRequestWriter(new BinaryRequestWriter());
     this.lbClient.setParser(new BinaryResponseParser());
     this.updatesToLeaders = updatesToLeaders;
@@ -362,7 +390,9 @@ public class CloudSolrClient extends SolrClient {
    * @param lbClient
    *          LBHttpSolrServer instance for requests.
    * @see #CloudSolrClient(String) for full description and details on zkHost
+   * @deprecated use {@link CloudSolrClient.Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(String zkHost, LBHttpSolrClient lbClient) {
     this(zkHost, lbClient, true);
   }
@@ -375,7 +405,9 @@ public class CloudSolrClient extends SolrClient {
    * @param updatesToLeaders
    *          If true, sends updates only to shard leaders.
    * @see #CloudSolrClient(String) for full description and details on zkHost
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public CloudSolrClient(String zkHost, LBHttpSolrClient lbClient, boolean updatesToLeaders) {
     this.zkHost = zkHost;
     this.lbClient = lbClient;
@@ -1340,4 +1372,137 @@ public class CloudSolrClient extends SolrClient {
     }    
     return results;
   }
+
+  private static LBHttpSolrClient createLBHttpSolrClient(HttpClient httpClient) {
+    final LBHttpSolrClient lbClient = new LBHttpSolrClient.Builder()
+        .withHttpClient(httpClient)
+        .build();
+    lbClient.setRequestWriter(new BinaryRequestWriter());
+    lbClient.setParser(new BinaryResponseParser());
+    
+    return lbClient;
+  }
+  
+  private static String buildZkHostString(Collection<String> zkHosts, String chroot) {
+    if (zkHosts == null || zkHosts.isEmpty()) {
+      throw new IllegalArgumentException("Cannot create CloudSearchClient without valid ZooKeeper host; none specified!");
+    }
+    
+    StringBuilder zkBuilder = new StringBuilder();
+    int lastIndexValue = zkHosts.size() - 1;
+    int i = 0;
+    for (String zkHost : zkHosts) {
+      zkBuilder.append(zkHost);
+      if (i < lastIndexValue) {
+        zkBuilder.append(",");
+      }
+      i++;
+    }
+    if (chroot != null) {
+      if (chroot.startsWith("/")) {
+        zkBuilder.append(chroot);
+      } else {
+        throw new IllegalArgumentException(
+            "The chroot must start with a forward slash.");
+      }
+    }
+
+    /* Log the constructed connection string and then initialize. */
+    final String zkHostString = zkBuilder.toString();
+    log.info("Final constructed zkHost string: " + zkHostString);
+    return zkHostString;
+  }
+  
+  /**
+   * Constructs {@link CloudSolrClient} instances from provided configuration.
+   */
+  public static class Builder {
+    private Collection<String> zkHosts;
+    private HttpClient httpClient;
+    private String zkChroot;
+    private LBHttpSolrClient loadBalancedSolrClient;
+    private boolean shardLeadersOnly;
+    
+    public Builder() {
+      this.zkHosts = new ArrayList();
+      this.shardLeadersOnly = true;
+    }
+    
+    /**
+     * Provide a ZooKeeper client endpoint to be used when configuring {@link CloudSolrClient} instances.
+     * 
+     * Method may be called multiple times.  All provided values will be used.
+     * 
+     * @param zkHost
+     *          The client endpoint of the ZooKeeper quorum containing the cloud
+     *          state.
+     */
+    public Builder withZkHost(String zkHost) {
+      this.zkHosts.add(zkHost);
+      return this;
+    }
+    
+    /**
+     * Provides a {@link HttpClient} for the builder to use when creating clients.
+     */
+    public Builder withHttpClient(HttpClient httpClient) {
+      this.httpClient = httpClient;
+      return this;
+    }
+    
+    /**
+     * Provide a series of ZooKeeper client endpoints for the builder to use when creating clients.
+     * 
+     * Method may be called multiple times.  All provided values will be used.
+     * 
+     * @param zkHosts
+     *          A Java Collection (List, Set, etc) of HOST:PORT strings, one for
+     *          each host in the ZooKeeper ensemble. Note that with certain
+     *          Collection types like HashSet, the order of hosts in the final
+     *          connect string may not be in the same order you added them.
+     */
+    public Builder withZkHost(Collection<String> zkHosts) {
+      this.zkHosts.addAll(zkHosts);
+      return this;
+    }
+
+    /**
+     * Provides a ZooKeeper chroot for the builder to use when creating clients.
+     */
+    public Builder withZkChroot(String zkChroot) {
+      this.zkChroot = zkChroot;
+      return this;
+    }
+    
+    /**
+     * Provides a {@link LBHttpSolrClient} for the builder to use when creating clients.
+     */
+    public Builder withLBHttpSolrClient(LBHttpSolrClient loadBalancedSolrClient) {
+      this.loadBalancedSolrClient = loadBalancedSolrClient;
+      return this;
+    }
+
+    /**
+     * Tells {@link Builder} that created clients should send updats only to shard leaders.
+     */
+    public Builder sendUpdatesOnlyToShardLeaders() {
+      shardLeadersOnly = true;
+      return this;
+    }
+    
+    /**
+     * Tells {@link Builder} that created clients should send updates to all replicas for a shard.
+     */
+    public Builder sendUpdatesToAllReplicasInShard() {
+      shardLeadersOnly = false;
+      return this;
+    }
+
+    /**
+     * Create a {@link CloudSolrClient} based on the provided configuration.
+     */
+    public CloudSolrClient build() {
+      return new CloudSolrClient(zkHosts, zkChroot, httpClient, loadBalancedSolrClient, shardLeadersOnly);
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f479f16d/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 5bec96a..c58baad 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
@@ -16,6 +16,21 @@
  */
 package org.apache.solr.client.solrj.impl;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.invoke.MethodHandles;
+import java.nio.charset.StandardCharsets;
+import java.util.LinkedList;
+import java.util.Locale;
+import java.util.Queue;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.NameValuePair;
@@ -45,21 +60,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.invoke.MethodHandles;
-import java.nio.charset.StandardCharsets;
-import java.util.LinkedList;
-import java.util.Locale;
-import java.util.Queue;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
 /**
  * ConcurrentUpdateSolrClient buffers all added documents and writes
  * them into open HTTP connections. This class is thread safe.
@@ -96,7 +96,10 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
    *          The buffer size before the documents are sent to the server
    * @param threadCount
    *          The number of background threads used to empty the queue
+   *          
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public ConcurrentUpdateSolrClient(String solrServerUrl, int queueSize,
                                     int threadCount) {
     this(solrServerUrl, null, queueSize, threadCount);
@@ -104,6 +107,10 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
     internalHttpClient = true;
   }
   
+  /**
+   * @deprecated use {@link Builder} instead.
+   */
+  @Deprecated
   public ConcurrentUpdateSolrClient(String solrServerUrl,
                                     HttpClient client, int queueSize, int threadCount) {
     this(solrServerUrl, client, queueSize, threadCount, ExecutorUtil.newMDCAwareCachedThreadPool(
@@ -113,7 +120,10 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
 
   /**
    * Uses the supplied HttpClient to send documents to the Solr server.
+   * 
+   * @deprecated use {@link Builder} instead.
    */
+  @Deprecated
   public ConcurrentUpdateSolrClient(String solrServerUrl,
                                     HttpClient client, int queueSize, int threadCount, ExecutorService es) {
     this(solrServerUrl, client, queueSize, threadCount, es, false);
@@ -121,16 +131,30 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
   
   /**
    * Uses the supplied HttpClient to send documents to the Solr server.
+   * 
+   * @deprecated use {@link Builder} instead.  This will soon be a
+   * protected method, and will only be available for use in implementing subclasses.
    */
+  @Deprecated
   public ConcurrentUpdateSolrClient(String solrServerUrl,
                                     HttpClient client, int queueSize, int threadCount, ExecutorService es, boolean streamDeletes) {
-    this.client = new HttpSolrClient(solrServerUrl, client);
+    this.internalHttpClient = (client == null);
+    this.client = new HttpSolrClient.Builder(solrServerUrl)
+        .withHttpClient(client)
+        .build();
     this.client.setFollowRedirects(false);
     queue = new LinkedBlockingQueue<>(queueSize);
     this.threadCount = threadCount;
     runners = new LinkedList<>();
-    scheduler = es;
     this.streamDeletes = streamDeletes;
+    
+    if (es != null) {
+      scheduler = es;
+      shutdownExecutor = false;
+    } else {
+      scheduler = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("concurrentUpdateScheduler"));
+      shutdownExecutor = true;
+    }
   }
 
   public Set<String> getQueryParams() {
@@ -274,6 +298,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
 
           method = new HttpPost(client.getBaseURL() + "/update"
               + requestParams.toQueryString());
+
           method.setEntity(template);
           method.addHeader("User-Agent", HttpSolrClient.AGENT);
           method.addHeader("Content-Type", contentType);
@@ -530,4 +555,91 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
   public void setRequestWriter(RequestWriter requestWriter) {
     client.setRequestWriter(requestWriter);
   }
+  
+  /**
+   * Constructs {@link ConcurrentUpdateSolrClient} instances from provided configuration.
+   */
+  public static class Builder {
+    private String baseSolrUrl;
+    private HttpClient httpClient;
+    private int queueSize;
+    private int threadCount;
+    private ExecutorService executorService;
+    private boolean streamDeletes;
+
+    /**
+     * Create a Builder object, based on the provided Solr URL.
+     * 
+     * @param baseSolrUrl the base URL of the Solr server that will be targeted by any created clients.
+     */
+    public Builder(String baseSolrUrl) {
+      this.baseSolrUrl = baseSolrUrl;
+    }
+
+    /**
+     * Provides a {@link HttpClient} for the builder to use when creating clients.
+     */
+    public Builder withHttpClient(HttpClient httpClient) {
+      this.httpClient = httpClient;
+      return this;
+    }
+    
+    /**
+     * The number of documents to batch together before sending to Solr.
+     */
+    public Builder withQueueSize(int queueSize) {
+      if (queueSize <= 0) {
+        throw new IllegalArgumentException("queueSize must be a positive integer.");
+      }
+      this.queueSize = queueSize;
+      return this;
+    }
+    
+    /**
+     * The number of threads used to empty {@link ConcurrentUpdateSolrClient}s queue.
+     */
+    public Builder withThreadCount(int threadCount) {
+      if (threadCount <= 0) {
+        throw new IllegalArgumentException("threadCount must be a positive integer.");
+      }
+      
+      this.threadCount = threadCount;
+      return this;
+    }
+    
+    /**
+     * Provides the {@link ExecutorService} for clients to use when servicing requests.
+     */
+    public Builder withExecutorService(ExecutorService executorService) {
+      this.executorService = executorService;
+      return this;
+    }
+    
+    /**
+     * Configures created clients to always stream delete requests.
+     */
+    public Builder alwaysStreamDeletes() {
+      this.streamDeletes = true;
+      return this;
+    }
+    
+    /**
+     * Configures created clients to not stream delete requests.
+     */
+    public Builder neverStreamDeletes() {
+      this.streamDeletes = false;
+      return this;
+    }
+    
+    /**
+     * Create a {@link ConcurrentUpdateSolrClient} based on the provided configuration options.
+     */
+    public ConcurrentUpdateSolrClient build() {
+      if (baseSolrUrl == null) {
+        throw new IllegalArgumentException("Cannot create HttpSolrClient without a valid baseSolrUrl!");
+      }
+      
+      return new ConcurrentUpdateSolrClient(baseSolrUrl, httpClient, queueSize, threadCount, executorService, streamDeletes);
+    }
+  }
 }


Mime
View raw message