类 ZookeeperClient
java.lang.Object
org.apache.shenyu.sync.data.zookeeper.ZookeeperClient
- 所有已实现的接口:
AutoCloseable
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明org.apache.curator.framework.recipes.cache.TreeCacheadd new curator cache.voidclose()start.voidcreateOrUpdate(String key, Object value, org.apache.zookeeper.CreateMode mode) create or update key with value.voidcreateOrUpdate(String key, String value, org.apache.zookeeper.CreateMode mode) create or update key with value.voiddelete a node with specific key.get value for specific key.org.apache.curator.framework.recipes.cache.TreeCacheget created cache.getChildren(String key) get children with specific key.org.apache.curator.framework.CuratorFrameworkget curator framework.getDirectly(String key) get from zk directly.booleancheck if key exist.voidstart()start.
-
构造器详细资料
-
ZookeeperClient
-
-
方法详细资料
-
start
public void start()start. -
close
public void close()start.- 指定者:
close在接口中AutoCloseable
-
getClient
public org.apache.curator.framework.CuratorFramework getClient()get curator framework.- 返回:
- curator framework client.
-
isExist
check if key exist.- 参数:
key- zookeeper path- 返回:
- if exist.
-
getDirectly
get from zk directly.- 参数:
key- zookeeper path- 返回:
- value.
-
get
get value for specific key.- 参数:
key- zookeeper path- 返回:
- value.
-
createOrUpdate
create or update key with value.- 参数:
key- zookeeper path key.value- string value.mode- creation mode.
-
createOrUpdate
create or update key with value.- 参数:
key- zookeeper path key.value- object value.mode- creation mode.
-
delete
delete a node with specific key.- 参数:
key- zookeeper path key.
-
getChildren
get children with specific key.- 参数:
key- zookeeper key.- 返回:
- children node name.
-
getCache
get created cache.- 参数:
path- path.- 返回:
- cache.
-
addCache
public org.apache.curator.framework.recipes.cache.TreeCache addCache(String path, org.apache.curator.framework.recipes.cache.TreeCacheListener... listeners) add new curator cache.- 参数:
path- path.listeners- listeners.- 返回:
- cache.
-