org.apache.solr.common.cloud

## Class ZkConfigManager

- java.lang.Object
- - org.apache.solr.common.cloud.ZkConfigManager

    public class ZkConfigManager
    extends Object

Class that manages named configs in Zookeeper

### Field Summary

Fields
`static String` `CONFIGS_ZKNODE` ZkNode where named configs are stored

### Constructor Summary

Constructors
Constructor and Description
`ZkConfigManager(SolrZkClient zkClient)` Creates a new ZkConfigManager

### Method Summary

All Methods Instance Methods Concrete Methods
`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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CONFIGS_ZKNODE

    public static final String CONFIGS_ZKNODE

ZkNode where named configs are stored

See Also:
  Constant Field Values

### Constructor Detail

#### ZkConfigManager

    public ZkConfigManager(SolrZkClient zkClient)

Creates a new ZkConfigManager

Parameters:
  `zkClient` - the `SolrZkClient` to use

### Method Detail

#### uploadConfigDir

    public void uploadConfigDir(Path dir,
                                String configName)
                         throws IOException

Upload files from a given path to a config in Zookeeper

Parameters:
  `dir` - `Path` to the files
  `configName` - the name to give the config
Throws:
  `IOException` - if an I/O error occurs or the path does not exist

#### downloadConfigDir

    public void downloadConfigDir(String configName,
                                  Path dir)
                           throws IOException

Download a config from Zookeeper and write it to the filesystem

Parameters:
  `configName` - the config to download
  `dir` - the `Path` to write files under
Throws:
  `IOException` - if an I/O error occurs or the config does not exist

#### listConfigs

    public List<String> listConfigs()
                             throws IOException

Throws:
  `IOException`

#### configExists

    public Boolean configExists(String configName)
                         throws IOException

Check whether a config exists in Zookeeper

Parameters:
  `configName` - the config to check existance on
Returns:
  whether the config exists or not
Throws:
  `IOException` - if an I/O error occurs

#### deleteConfigDir

    public void deleteConfigDir(String configName)
                         throws IOException

Delete a config in ZooKeeper

Parameters:
  `configName` - the config to delete
Throws:
  `IOException` - if an I/O error occurs

#### copyConfigDir

    public void copyConfigDir(String fromConfig,
                              String toConfig)
                       throws IOException

Copy a config in ZooKeeper

Parameters:
  `fromConfig` - the config to copy from
  `toConfig` - the config to copy to
Throws:
  `IOException` - if an I/O error occurs

#### copyConfigDir

    public void copyConfigDir(String fromConfig,
                              String toConfig,
                              Set<String> copiedToZkPaths)
                       throws IOException

Copy a config in ZooKeeper

Parameters:
  `fromConfig` - the config to copy from
  `toConfig` - the config to copy to
  `copiedToZkPaths` - should be an empty Set, will be filled in by function with the paths that were actually copied to.
Throws:
  `IOException` - if an I/O error occurs