Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17066 Fix ShardSplitTest & StressHdfsTest #2457

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1277,9 +1277,7 @@ protected void splitShard(
QueryRequest request = new QueryRequest(params);
request.setPath("/admin/collections");

String baseUrl =
((HttpSolrClient) shardToJetty.get(SHARD1).get(0).client.getSolrClient()).getBaseURL();
baseUrl = baseUrl.substring(0, baseUrl.length() - "collection1".length());
String baseUrl = shardToJetty.get(SHARD1).get(0).jetty.getBaseUrl().toString();

try (SolrClient baseServer =
new HttpSolrClient.Builder(baseUrl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,8 @@ private void createAndDeleteCollection() throws Exception {
}
}
}

protected String getBaseUrl(SolrClient client) {
return ((HttpSolrClient) client).getBaseURL();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ public ModifiableSolrParams getInvariantParams() {
return invariantParams;
}

/** Typically looks like {@code http://localhost:8983/solr} (no core or collection) */
public String getBaseURL() {
return baseUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,16 +1115,6 @@ public static void createCollectionInOneInstance(
}
}

protected String getBaseUrl(SolrClient client) {
String url2 =
((HttpSolrClient) client)
.getBaseURL()
.substring(
0,
((HttpSolrClient) client).getBaseURL().length() - DEFAULT_COLLECTION.length() - 1);
return url2;
}

@Override
protected CollectionAdminResponse createCollection(
Map<String, List<Integer>> collectionInfos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ public static class CloudJettyRunner {
public JettySolrRunner jetty;
public String nodeName;
public String coreNodeName;

/** Core or Collection URL */
public String url;

public CloudSolrServerClient client;
public ZkNodeProps info;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,7 @@ public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}

/**
* Returns a base URL consisting of the protocol, host, and port for a Connector in use by the
* Jetty Server contained in this runner.
*/
/** Returns a base URL like {@code http://localhost:8983/solr} */
public URL getBaseUrl() {
try {
return new URL(protocol, host, jettyPort, "/solr");
Expand Down