public class ZkConfigManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONFIGS_ZKNODE
ZkNode where named configs are stored
|
Constructor and Description |
---|
ZkConfigManager(SolrZkClient zkClient)
Creates a new ZkConfigManager
|
Modifier and Type | Method and Description |
---|---|
Boolean |
configExists(String configName)
Check whether a config exists in Zookeeper
|
void |
copyConfigDir(String fromConfig,
String toConfig)
Copy a config in ZooKeeper
|
void |
copyConfigDir(String fromConfig,
String toConfig,
Set<String> copiedToZkPaths)
Copy a config in ZooKeeper
|
void |
deleteConfigDir(String configName)
Delete a config in ZooKeeper
|
void |
downloadConfigDir(String configName,
Path dir)
Download a config from Zookeeper and write it to the filesystem
|
List<String> |
listConfigs() |
void |
uploadConfigDir(Path dir,
String configName)
Upload files from a given path to a config in Zookeeper
|
public static final String CONFIGS_ZKNODE
public ZkConfigManager(SolrZkClient zkClient)
zkClient
- the SolrZkClient
to usepublic void uploadConfigDir(Path dir, String configName) throws IOException
dir
- Path
to the filesconfigName
- the name to give the configIOException
- if an I/O error occurs or the path does not existpublic void downloadConfigDir(String configName, Path dir) throws IOException
configName
- the config to downloaddir
- the Path
to write files underIOException
- if an I/O error occurs or the config does not existpublic List<String> listConfigs() throws IOException
IOException
public Boolean configExists(String configName) throws IOException
configName
- the config to check existance onIOException
- if an I/O error occurspublic void deleteConfigDir(String configName) throws IOException
configName
- the config to deleteIOException
- if an I/O error occurspublic void copyConfigDir(String fromConfig, String toConfig) throws IOException
fromConfig
- the config to copy fromtoConfig
- the config to copy toIOException
- if an I/O error occurspublic void copyConfigDir(String fromConfig, String toConfig, Set<String> copiedToZkPaths) throws IOException
fromConfig
- the config to copy fromtoConfig
- the config to copy tocopiedToZkPaths
- should be an empty Set, will be filled in by function
with the paths that were actually copied to.IOException
- if an I/O error occursCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.