类 ZookeeperClient

java.lang.Object
org.apache.shenyu.sync.data.zookeeper.ZookeeperClient
所有已实现的接口:
AutoCloseable

public class ZookeeperClient extends Object implements AutoCloseable
  • 构造器详细资料

    • ZookeeperClient

      public ZookeeperClient(ZookeeperConfig zookeeperConfig)
  • 方法详细资料

    • 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

      public boolean isExist(String key)
      check if key exist.
      参数:
      key - zookeeper path
      返回:
      if exist.
    • getDirectly

      public String getDirectly(String key)
      get from zk directly.
      参数:
      key - zookeeper path
      返回:
      value.
    • get

      public String get(String key)
      get value for specific key.
      参数:
      key - zookeeper path
      返回:
      value.
    • createOrUpdate

      public void createOrUpdate(String key, String value, org.apache.zookeeper.CreateMode mode)
      create or update key with value.
      参数:
      key - zookeeper path key.
      value - string value.
      mode - creation mode.
    • createOrUpdate

      public void createOrUpdate(String key, Object value, org.apache.zookeeper.CreateMode mode)
      create or update key with value.
      参数:
      key - zookeeper path key.
      value - object value.
      mode - creation mode.
    • delete

      public void delete(String key)
      delete a node with specific key.
      参数:
      key - zookeeper path key.
    • getChildren

      public List<String> getChildren(String key)
      get children with specific key.
      参数:
      key - zookeeper key.
      返回:
      children node name.
    • getCache

      public org.apache.curator.framework.recipes.cache.TreeCache getCache(String path)
      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.