1.

Explain The Methods Of Zookeeperclass?

Answer»

The central part of the ZOOKEEPER API is ZooKeeper class. It provides options to connect the ZooKeeper ensemble in its constructor and has the following methods -

connect - connect to the ZooKeeper ensemble

ZooKeeper(String connectionString, int sessionTimeout, Watcher watcher)

create - create a znode

create(String path, byte[] data, List acl, CreateMode createMode)

exists - CHECK WHETHER a znode exists and its information

exists(String path, BOOLEAN watcher)

getData - get data from a particular znode

getData(String path, Watcher watcher, Stat stat)

setData - set data in a particular znode

setData(String path, byte[] data, int version)

getChildren - get all sub-nodes available in a particular znode

getChildren(String path, Watcher watcher)

delete - get a particular znode and all its children

delete(String path, int version)

close - close a connection

The central part of the ZooKeeper API is ZooKeeper class. It provides options to connect the ZooKeeper ensemble in its constructor and has the following methods -

connect - connect to the ZooKeeper ensemble

ZooKeeper(String connectionString, int sessionTimeout, Watcher watcher)

create - create a znode

create(String path, byte[] data, List acl, CreateMode createMode)

exists - check whether a znode exists and its information

exists(String path, boolean watcher)

getData - get data from a particular znode

getData(String path, Watcher watcher, Stat stat)

setData - set data in a particular znode

setData(String path, byte[] data, int version)

getChildren - get all sub-nodes available in a particular znode

getChildren(String path, Watcher watcher)

delete - get a particular znode and all its children

delete(String path, int version)

close - close a connection



Discussion

No Comment Found