本文整理了Java中org.apache.solr.common.cloud.ZkConfigManager.downloadConfigDir()
方法的一些代码示例,展示了ZkConfigManager.downloadConfigDir()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkConfigManager.downloadConfigDir()
方法的具体详情如下:
包路径:org.apache.solr.common.cloud.ZkConfigManager
类名称:ZkConfigManager
方法名:downloadConfigDir
[英]Download a config from Zookeeper and write it to the filesystem
[中]从Zookeeper下载配置并将其写入文件系统
代码示例来源:origin: org.apache.solr/solr-solrj
public static void downConfig(SolrZkClient zkClient, String confName, Path confPath) throws IOException {
ZkConfigManager manager = new ZkConfigManager(zkClient);
// Try to download the configset
manager.downloadConfigDir(confName, confPath);
}
代码示例来源:origin: kite-sdk/kite
/**
* Download and return the config directory from ZK
*/
public File downloadConfigDir(SolrZkClient zkClient, String configName, File dir)
throws IOException, InterruptedException, KeeperException {
Preconditions.checkArgument(dir.exists());
Preconditions.checkArgument(dir.isDirectory());
ZkConfigManager manager = new ZkConfigManager(zkClient);
manager.downloadConfigDir(configName, dir.toPath());
File confDir = new File(dir, "conf");
if (!confDir.isDirectory()) {
// create a temporary directory with "conf" subdir and mv the config in there. This is
// necessary because of CDH-11188; solrctl does not generate nor accept directories with e.g.
// conf/solrconfig.xml which is necessary for proper solr operation. This should work
// even if solrctl changes.
confDir = new File(Files.createTempDir().getAbsolutePath(), "conf");
confDir.getParentFile().deleteOnExit();
Files.move(dir, confDir);
dir = confDir.getParentFile();
}
verifyConfigDir(confDir);
return dir;
}
代码示例来源:origin: org.apache.solr/solr-solrj
/**
* Download a named config from Zookeeper to a location on the filesystem
* @param configName the name of the config
* @param downloadPath the path to write config files to
* @throws IOException if an I/O exception occurs
*/
public void downloadConfig(String configName, Path downloadPath) throws IOException {
connect();
zkStateReader.getConfigManager().downloadConfigDir(configName, downloadPath);
}
代码示例来源:origin: com.hynnet/solr-solrj
/**
* Download a named config from Zookeeper to a location on the filesystem
* @param configName the name of the config
* @param downloadPath the path to write config files to
* @throws IOException if an I/O exception occurs
*/
public void downloadConfig(String configName, Path downloadPath) throws IOException {
connect();
zkStateReader.getConfigManager().downloadConfigDir(configName, downloadPath);
}
代码示例来源:origin: org.apache.solr/solr-morphlines-core
/**
* Download and return the config directory from ZK
*/
public File downloadConfigDir(SolrZkClient zkClient, String configName, File dir)
throws IOException, InterruptedException, KeeperException {
Preconditions.checkArgument(dir.exists());
Preconditions.checkArgument(dir.isDirectory());
ZkConfigManager manager = new ZkConfigManager(zkClient);
manager.downloadConfigDir(configName, dir.toPath());
File confDir = new File(dir, "conf");
if (!confDir.isDirectory()) {
// create a temporary directory with "conf" subdir and mv the config in there. This is
// necessary because of CDH-11188; solrctl does not generate nor accept directories with e.g.
// conf/solrconfig.xml which is necessary for proper solr operation. This should work
// even if solrctl changes.
confDir = new File(Files.createTempDir().getAbsolutePath(), "conf");
confDir.getParentFile().deleteOnExit();
Files.move(dir, confDir);
dir = confDir.getParentFile();
}
verifyConfigDir(confDir);
return dir;
}
代码示例来源:origin: com.cloudera.search/search-mr
dir.deleteOnExit();
ZkConfigManager configManager = new ZkConfigManager(zkClient);
configManager.downloadConfigDir(configName, dir.toPath());
File confDir = new File(dir, "conf");
if (!confDir.isDirectory()) {
内容来源于网络,如有侵权,请联系作者删除!