janhoy commented on code in PR #4267:
URL: https://github.com/apache/solr/pull/4267#discussion_r3044838801
##########
solr/core/src/java/org/apache/solr/cli/ConfigSetDownloadTool.java:
##########
@@ -74,36 +88,53 @@ public String getUsage() {
@Override
public void runImpl(CommandLine cli) throws Exception {
String zkHost = CLIUtils.getZkHost(cli);
-
String confName = cli.getOptionValue(CONF_NAME_OPTION);
String confDir = cli.getOptionValue(CONF_DIR_OPTION);
echoIfVerbose("\nConnecting to ZooKeeper at " + zkHost + " ...");
try (SolrZkClient zkClient = CLIUtils.getSolrZkClient(cli, zkHost)) {
- Path configSetPath = Path.of(confDir);
- // we try to be nice about having the "conf" in the directory, and we
create it if it's not
- // there.
- if (!configSetPath.endsWith("/conf")) {
- configSetPath = configSetPath.resolve("conf");
- }
- Files.createDirectories(configSetPath);
- echo(
- "Downloading configset "
- + confName
- + " from ZooKeeper at "
- + zkHost
- + " to directory "
- + configSetPath.toAbsolutePath());
-
- zkClient.downConfig(confName, configSetPath);
+ doDownconfig(zkClient, zkHost, confName, confDir);
} catch (Exception e) {
log.error("Could not complete downconfig operation for reason: ", e);
throw (e);
}
}
+ private void doDownconfig(SolrZkClient zkClient, String zkHost, String
confName, String confDir)
+ throws Exception {
+ Path configSetPath = Path.of(confDir);
+ // we try to be nice about having the "conf" in the directory, and we
create it if it's not
+ // there.
+ if (!configSetPath.endsWith("/conf")) {
Review Comment:
This is in pre-existing code, so could very well be a bug.
--
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]