public class ZkClientClusterStateProvider extends Object
Constructor and Description |
---|
ZkClientClusterStateProvider(Collection<String> zkHosts,
String chroot) |
ZkClientClusterStateProvider(String zkHost) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
connect() |
void |
downloadConfig(String configName,
Path downloadPath)
Download a named config from Zookeeper to a location on the filesystem
|
String |
getAlias(String collection) |
Map<String,Object> |
getClusterProperties() |
String |
getCollectionName(String name) |
ClusterState.CollectionRef |
getState(String collection) |
Set<String> |
liveNodes() |
String |
toString() |
void |
uploadConfig(Path configPath,
String configName)
Upload a set of config files to Zookeeper and give it a name
NOTE: You should only allow trusted users to upload configs.
|
public ZkClientClusterStateProvider(Collection<String> zkHosts, String chroot)
public ZkClientClusterStateProvider(String zkHost)
public ClusterState.CollectionRef getState(String collection)
public void downloadConfig(String configName, Path downloadPath) throws IOException
configName
- the name of the configdownloadPath
- the path to write config files toIOException
- if an I/O exception occurspublic void uploadConfig(Path configPath, String configName) throws IOException
configPath
- Path
to the config filesconfigName
- the name of the configIOException
- if an IO error occurspublic void connect()
public void close() throws IOException
IOException
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.