Package org.apache.storm.zookeeper
Class ClientZookeeper
java.lang.Object
org.apache.storm.zookeeper.ClientZookeeper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addListener
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, org.apache.storm.shade.org.apache.curator.framework.state.ConnectionStateListener listener) 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) 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) static void
deleteNode
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String path) static void
deleteNodeBlobstore
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String parentPath, String hostPortInfo) static boolean
exists
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String path, boolean watch) static boolean
existsNode
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String path, boolean watch) getChildren
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String path, boolean watch) static byte[]
getData
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String path, boolean watch) 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.static Integer
getVersion
(org.apache.storm.shade.org.apache.curator.framework.CuratorFramework zk, String path, boolean watch) static org.apache.storm.shade.org.apache.curator.framework.CuratorFramework
mkClient
(Map<String, Object> conf, List<String> servers, Object port, String root, WatcherCallBack watcher, Map<String, Object> authConf, DaemonType type) org.apache.storm.shade.org.apache.curator.framework.CuratorFramework
mkClientImpl
(Map<String, Object> conf, List<String> servers, Object port, String root, WatcherCallBack watcher, Map<String, Object> authConf, DaemonType type) 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) 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) static String
normalizePath
(String path) static String
parentPath
(String path) static void
Resets the singleton instance to the default.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) static void
Provide an instance of this class for delegates to use.static void
tokenizePath
(String path) static String
toksToPath
(List<String> toks)
-
Constructor Details
-
ClientZookeeper
public ClientZookeeper()
-
-
Method Details
-
setInstance
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
-
mkClient
-
deleteNodeBlobstore
-
createNode
-
createNode
-
tokenizePath
-
toksToPath
-
normalizePath
-
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
-
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
-
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 usepath
- the path to get it fromwatch
- 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
-
mkClientImpl
-