Skip to content

Commit

Permalink
back out credentials support, we generate a brand new client in Packa…
Browse files Browse the repository at this point in the history
…geToolTest anyway, and http2 change was breaking things.
  • Loading branch information
epugh committed Sep 29, 2023
1 parent 50bcd10 commit 5145071
Showing 1 changed file with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.embedded.SSLConfig;
import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
import org.apache.solr.client.solrj.impl.CloudLegacySolrClient;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.Http2SolrClient;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.request.ConfigSetAdminRequest;
import org.apache.solr.common.SolrException;
Expand Down Expand Up @@ -161,7 +159,6 @@ public class MiniSolrCloudCluster {
private final List<JettySolrRunner> jettys = new CopyOnWriteArrayList<>();
private final Path baseDir;
private CloudSolrClient solrClient;
private final String credentials;
private final JettyConfig jettyConfig;
private final boolean trackJettyMetrics;

Expand Down Expand Up @@ -245,7 +242,6 @@ public MiniSolrCloudCluster(
jettyConfig,
zkTestServer,
securityJson,
null,
false,
formatZkServer);
}
Expand All @@ -270,7 +266,6 @@ public MiniSolrCloudCluster(
JettyConfig jettyConfig,
ZkTestServer zkTestServer,
Optional<String> securityJson,
String credentials,
boolean trackJettyMetrics,
boolean formatZkServer)
throws Exception {
Expand All @@ -279,7 +274,6 @@ public MiniSolrCloudCluster(
this.baseDir = Objects.requireNonNull(baseDir);
this.jettyConfig = Objects.requireNonNull(jettyConfig);
this.trackJettyMetrics = trackJettyMetrics;
this.credentials = credentials;

log.info("Starting cluster of {} servers in {}", numServers, baseDir);

Expand Down Expand Up @@ -750,22 +744,11 @@ public void zkSetData(String path, byte[] data, boolean retryOnConnLoss)
}

protected CloudSolrClient buildSolrClient() {
Http2SolrClient.Builder builder =
new Http2SolrClient.Builder()
.withIdleTimeout(15, TimeUnit.SECONDS)
.withConnectionTimeout(90, TimeUnit.SECONDS)
.withOptionalBasicAuthCredentials(credentials);
return new CloudHttp2SolrClient.Builder(
return new CloudLegacySolrClient.Builder(
Collections.singletonList(getZkServer().getZkAddress()), Optional.empty())
.withInternalClientBuilder(builder)
.build();

// return new CloudLegacySolrClient.Builder(
// Collections.singletonList(getZkServer().getZkAddress()), Optional.empty())
// .withSocketTimeout(90000, TimeUnit.MILLISECONDS)
// .withConnectionTimeout(15000, TimeUnit.MILLISECONDS)
// .withO
// .build(); // we choose 90 because we run in some harsh envs
.withSocketTimeout(90000, TimeUnit.MILLISECONDS)
.withConnectionTimeout(15000, TimeUnit.MILLISECONDS)
.build(); // we choose 90 because we run in some harsh envs
}

/**
Expand Down Expand Up @@ -1277,7 +1260,6 @@ public MiniSolrCloudCluster build() throws Exception {
jettyConfig,
null,
securityJson,
credentials,
trackJettyMetrics,
formatZkServer);
for (Config config : configs) {
Expand Down

0 comments on commit 5145071

Please sign in to comment.