public class Zk extends Object
Modifier and Type | Field and Description |
---|---|
static org.apache.curator.framework.CuratorFramework |
zkclient |
Constructor and Description |
---|
Zk() |
Modifier and Type | Method and Description |
---|---|
static void |
addPathChildrenCacheListener(String path,
org.apache.curator.framework.recipes.cache.PathChildrenCacheListener pathChildrenCacheListener) |
static void |
createContainers(String path) |
static void |
createOrUpdate(String path,
byte[] content,
org.apache.zookeeper.CreateMode createMode) |
static void |
createOrUpdate(String path,
String content,
org.apache.zookeeper.CreateMode createMode) |
static void |
delete(String path) |
static boolean |
exists(String path) |
static byte[] |
getBytes(String path) |
static List<String> |
getChildren(String path) |
static String |
getString(String path) |
static String |
getString(String path,
String charset) |
static void |
init(String address,
ClientDecorator clientDecorator) |
static void |
setData(String path,
byte[] bs) |
static void |
setData(String path,
String content) |
static void |
start()
Start the client.
|
static void |
upload(String path,
String localpath,
org.apache.zookeeper.CreateMode createMode) |
public static void init(String address, ClientDecorator clientDecorator) throws Exception
address
- clientDecorator
- Exception
public static void start()
public static void createOrUpdate(String path, String content, org.apache.zookeeper.CreateMode createMode) throws Exception
path
- content
- createMode
- Exception
public static void createOrUpdate(String path, byte[] content, org.apache.zookeeper.CreateMode createMode) throws Exception
path
- content
- createMode
- Exception
public static void createContainers(String path) throws Exception
Exception
public static boolean exists(String path) throws Exception
path
- Exception
public static byte[] getBytes(String path) throws Exception
path
- Exception
public static String getString(String path, String charset) throws Exception
path
- charset
- Exception
public static List<String> getChildren(String path) throws Exception
path
- Exception
public static void upload(String path, String localpath, org.apache.zookeeper.CreateMode createMode) throws Exception
path
- localpath
- createMode
- Exception
public static void setData(String path, byte[] bs) throws Exception
path
- bs
- Exception
public static void setData(String path, String content) throws Exception
path
- content
- Exception
Copyright © 2021. All rights reserved.