Class ClientZookeeper


  • public class ClientZookeeper
    extends Object
    • Constructor Detail

      • ClientZookeeper

        public ClientZookeeper()
    • Method Detail

      • setInstance

        public static void setInstance​(ClientZookeeper u)
        Provide an instance of this class for delegates to use. To mock out delegated methods, provide an instance of a subclass that overrides the implementation of the delegated method.
        Parameters:
        u - a ClientZookeeper instance
      • resetInstance

        public static void resetInstance()
        Resets the singleton instance to the default. This is helpful to reset the class to its original functionality when mocking is no longer desired.
      • mkdirs

        public static void mkdirs​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                  String path,
                                  List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls)
      • deleteNodeBlobstore

        public static void deleteNodeBlobstore​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                               String parentPath,
                                               String hostPortInfo)
      • createNode

        public static String createNode​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                        String path,
                                        byte[] data,
                                        org.apache.storm.shade.org.apache.zookeeper.CreateMode mode,
                                        List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls)
      • createNode

        public static String createNode​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                        String path,
                                        byte[] data,
                                        List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls)
      • normalizePath

        public static String normalizePath​(String path)
      • existsNode

        public static boolean existsNode​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                         String path,
                                         boolean watch)
      • deleteNode

        public static void deleteNode​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                      String path)
      • parentPath

        public static String parentPath​(String path)
      • exists

        public static boolean exists​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                     String path,
                                     boolean watch)
      • setData

        public static org.apache.storm.shade.org.apache.zookeeper.data.Stat setData​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                                                                    String path,
                                                                                    byte[] data)
      • getVersion

        public static Integer getVersion​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                         String path,
                                         boolean watch)
                                  throws Exception
        Throws:
        Exception
      • getChildren

        public static List<String> getChildren​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                               String path,
                                               boolean watch)
      • getData

        public static byte[] getData​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                     String path,
                                     boolean watch)
      • getDataWithVersion

        public static VersionedData<byte[]> getDataWithVersion​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                                               String path,
                                                               boolean watch)
        Get the data along with a version.
        Parameters:
        zk - the zk instance to use
        path - the path to get it from
        watch - should a watch be enabled
        Returns:
        null if no data is found, else the data with the version.
      • addListener

        public static void addListener​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                       org.apache.storm.shade.org.apache.curator.framework.state.ConnectionStateListener listener)
      • syncPath

        public static void syncPath​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                                    String path)
      • mkdirsImpl

        public void mkdirsImpl​(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk,
                               String path,
                               List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> acls)