dsmiley commented on a change in pull request #23: URL: https://github.com/apache/solr/pull/23#discussion_r603761380
########## File path: solr/core/src/java/org/apache/solr/core/backup/BackupManager.java ########## @@ -296,51 +293,45 @@ public void downloadCollectionProperties(String collectionName) throws IOExcepti } } - private void downloadFromZK(SolrZkClient zkClient, String zkPath, URI dir) throws IOException { - try { - List<String> files = zkClient.getChildren(zkPath, null, true); - for (String file : files) { - List<String> children = zkClient.getChildren(zkPath + "/" + file, null, true); - if (children.size() == 0) { - log.debug("Writing file {}", file); - byte[] data = zkClient.getData(zkPath + "/" + file, null, null, true); - try (OutputStream os = repository.createOutput(repository.resolve(dir, file))) { - os.write(data); - } - } else { - URI uri = repository.resolve(dir, file); - if (!repository.exists(uri)) { - repository.createDirectory(uri); - } - downloadFromZK(zkClient, zkPath + "/" + file, repository.resolve(dir, file)); + private void downloadConfigToRepo(ConfigSetService configSetService, String configName, URI dir) throws IOException { + List<String> filePaths = configSetService.getAllConfigFiles(configName); + for (String filePath : filePaths) { + URI uri = repository.resolve(dir, filePath); + if (!filePath.endsWith("/")) { + log.debug("Writing file {}", filePath); + byte[] data = configSetService.downloadFileFromConfig(configName, filePath); + try (OutputStream os = repository.createOutput(uri)) { + os.write(data); + } + } else { + if (!repository.exists(uri)) { + repository.createDirectory(uri); } } - } catch (KeeperException | InterruptedException e) { - throw new IOException("Error downloading files from zookeeper path " + zkPath + " to " + dir.toString(), - SolrZkClient.checkInterrupted(e)); } } - private void uploadToZk(SolrZkClient zkClient, URI sourceDir, String destZkPath) throws IOException { + private void uploadConfigToConfigRepo(ConfigSetService configSetService, URI sourceDir, String configName, String filePrefix) throws IOException { Review comment: I suggest naming `uploadConfigFromRepo` or `uploadConfigToSolrCloud` -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org