janhoy commented on code in PR #2391:
URL: https://github.com/apache/solr/pull/2391#discussion_r3217570947
##########
solr/core/src/java/org/apache/solr/core/ZkContainer.java:
##########
@@ -241,9 +333,17 @@ public SolrMetricsContext getSolrMetricsContext() {
}
}
- private String stripChroot(String zkRun) {
- if (zkRun == null || zkRun.trim().isEmpty() || zkRun.lastIndexOf('/') < 0)
return zkRun;
- return zkRun.substring(0, zkRun.lastIndexOf('/'));
+ private void startZooKeeperServerEmbedded(int port, String zkHomeDir) throws
Exception {
+ Properties p = new Properties();
+ try (FileReader fr = new FileReader(zkHomeDir + "/zoo.cfg",
StandardCharsets.UTF_8)) {
+ p.load(fr);
+ }
Review Comment:
Redundant read of zoo.cfg, the file is already in memory in call site.
Refactor this method
--
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]