vyatkinv commented on code in PR #4320:
URL: https://github.com/apache/solr/pull/4320#discussion_r3214937482
##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java:
##########
@@ -76,36 +77,44 @@ public void setDefaultZKHost(String zkHost) {
}
}
- public synchronized CloudSolrClient getCloudSolrClient(String
connectionString) {
+ /**
+ * @deprecated use {@link
#getCloudSolrClient(CloudSolrClient.CloudSolrClientConnection)}
+ */
+ @Deprecated
+ public CloudSolrClient getCloudSolrClient(String solrConnectionString) {
+ var solrConnection =
CloudSolrClient.CloudSolrClientConnection.parse(solrConnectionString);
+ return getCloudSolrClient(solrConnection);
+ }
+
+ 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();
Review Comment:
done
##########
solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/ModelCache.java:
##########
@@ -31,20 +32,24 @@
public class ModelCache {
private LRU models;
- private String defaultZkHost;
+ private CloudSolrClient.CloudSolrClientConnection solrConnection;
private SolrClientCache solrClientCache;
public ModelCache(int size, String defaultZkHost, SolrClientCache
solrClientCache) {
this.models = new LRU(size);
- this.defaultZkHost = defaultZkHost;
+ this.solrConnection =
CloudSolrClient.CloudSolrClientConnection.parse(defaultZkHost);
Review Comment:
done
--
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]