dsmiley commented on code in PR #4320:
URL: https://github.com/apache/solr/pull/4320#discussion_r3177661058
##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java:
##########
@@ -76,36 +76,35 @@ public void setDefaultZKHost(String zkHost) {
}
}
- public synchronized CloudSolrClient getCloudSolrClient(String
connectionString) {
+ public synchronized CloudSolrClient getCloudSolrClient(
+ CloudSolrClient.CloudSolrClientConnection solrConnection) {
ensureOpen();
- Objects.requireNonNull(connectionString, "Connection string cannot be
null!");
- if (solrClients.containsKey(connectionString)) {
- return (CloudSolrClient) solrClients.get(connectionString);
+ Objects.requireNonNull(solrConnection, "'solrConnection' cannot be null!");
+ String cacheKey = solrConnection.toString();
+ if (solrClients.containsKey(cacheKey)) {
+ return (CloudSolrClient) solrClients.get(cacheKey);
}
// Can only use ZK ACLs if there is a default ZK Host, and the given ZK
host contains that
// default.
// Basically the ZK ACLs are assumed to be only used for the default ZK
host,
// thus we should only provide the ACLs to that Zookeeper instance.
boolean canUseACLs = false;
- var cloudClientConnection =
CloudSolrClient.CloudSolrClientConnection.parse(connectionString);
- if (cloudClientConnection.isZk()) {
- String chroot = cloudClientConnection.zkChroot();
- String zkHostNoChroot =
- chroot != null && connectionString.endsWith(chroot)
- ? connectionString.substring(0, connectionString.length() -
chroot.length())
- : connectionString;
+ if (solrConnection.isZk()) {
Review Comment:
10.1 hasn't shipped, so it can be changed easily now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]