ZkClient Jar包的使用

zookeeper有其官网的java客户端,可是使用起来不够人性化,因此有人对zookeeper客户端进行了封装,这就是ZkClient.java

今天试了下关于ZkClient的api使用。因为时间问题,先贴出来回头有时间在整理下api

(String[] args) {
        String serverString = ZkClient zkClient = ZkClient(serverString)isExist = zkClient.exists()System..println(isExist)zkClient.writeData()String data = zkClient.readData()System..println(data)}

    MyZkChildListener IZkChildListener {
        (String sList<String> list) Exception {
            System..println(+ s)System..println(+ list)}
    }
    MyZkDataChangeListener IZkDataListener {
        (String sObject o) Exception {
            System..println(s + + o)}

        (String s) Exception {
            System..println(s + )}
    }

    MyZkStatChangeListener IZkStateListener {

        (Watcher.Event.KeeperState keeperState) Exception {
            System..println()}

        () Exception {

        }

        (Throwable throwable) Exception {

        }
    }
相关文章
相关标签/搜索