Package org.I0Itec.zkclient

Examples of org.I0Itec.zkclient.IZkConnection


                        if (!lessThanMe.isEmpty()) {
                            // 关注一下排队在自己之前的最近的一个节点
                            LockNode lastChildName = lessThanMe.last();
                            lastChildId = lastChildName.getName();
                            // 异步watcher处理
                            IZkConnection connection = zookeeper.getConnection();
                            // zkclient包装的是一个持久化的zk,分布式lock只需要一次性的watcher,需要调用原始的zk链接进行操作
                            ZooKeeper orginZk = ((ZooKeeperx) connection).getZookeeper();
                            Stat stat = orginZk.exists(root + "/" + lastChildId, new AsyncWatcher() {

                                public void asyncProcess(WatchedEvent event) {
View Full Code Here


        }
        return Boolean.FALSE;
    }

    private long getSessionId() {
        IZkConnection connection = zookeeper.getConnection();
        return ((ZooKeeperx) connection).getZookeeper().getSessionId();
    }
View Full Code Here

TOP

Related Classes of org.I0Itec.zkclient.IZkConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.