merrimanr commented on a change in pull request #1367: METRON-2022: Metron rest
creates large number of connections to ZK which causes subsequent connection to
zk fail
URL: https://github.com/apache/metron/pull/1367#discussion_r270857074
##########
File path:
metron-platform/metron-solr/src/main/java/org/apache/metron/solr/dao/SolrMetaAlertDao.java
##########
@@ -144,10 +144,11 @@ protected String getDefaultSourceTypeField() {
}
};
- SolrClient solrClient = solrDao.getSolrClient(solrDao.getZkHosts());
+ SolrClient solrClient = solrDao.getSolrClient();
Review comment:
The `SolrDao` and `SolrMetaAlertDao` are created separately through
reflection in the REST `IndexConfig` class. Solr is a runtime dependency so
the `SolrClient` instance cannot be created in REST. There must be some way
for the client to be shared between them. The `getSolrClient` is simply
returning an existing client (not creating anything) so I feel it's pretty
safe. I'm happy to move it to the factory class if you think that makes more
sense.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services