public class ZkConfigManager extends Object
| 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 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 
 | 
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 
 | 
public static final String CONFIGS_ZKNODE
public static final String UPLOAD_FILENAME_EXCLUDE_REGEX
public static final Pattern UPLOAD_FILENAME_EXCLUDE_PATTERN
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 uploadConfigDir(Path dir, String configName, Pattern filenameExclusions) throws IOException
dir - Path to the filesconfigName - the name to give the configfilenameExclusions - files matching this pattern will not be uploadedIOException - 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
IOExceptionpublic 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 occurspublic static Path getConfigsetPath(String confDir, String configSetDir) throws IOException
IOExceptionCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.