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
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONFIGS_ZKNODE` ZkNode where named configs are stored
    `static Pattern` | `UPLOAD_FILENAME_EXCLUDE_PATTERN`
    `static String` | `UPLOAD_FILENAME_EXCLUDE_REGEX`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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
    `static Path` | `getConfigsetPath(String confDir, String configSetDir)`
    `List<String>` | `listConfigs()`
    `void` | `uploadConfigDir(Path dir, String configName)` Upload files from a given path to a config in Zookeeper
    `void` | `uploadConfigDir(Path dir, String configName, Pattern filenameExclusions)` Upload matching 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

    - #### UPLOAD_FILENAME_EXCLUDE_REGEX

          public static final String UPLOAD_FILENAME_EXCLUDE_REGEX

      See Also:
        Constant Field Values

    - #### UPLOAD_FILENAME_EXCLUDE_PATTERN

          public static final Pattern UPLOAD_FILENAME_EXCLUDE_PATTERN

  - ### 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

    - #### uploadConfigDir

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

      Upload matching files from a given path to a config in Zookeeper
      Parameters:
        `dir` - `Path` to the files
        `configName` - the name to give the config
        `filenameExclusions` - files matching this pattern will not be uploaded
      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

    - #### getConfigsetPath

          public static Path getConfigsetPath(String confDir,
                                              String configSetDir)
                                       throws IOException

      Throws:
        `IOException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.