Examples of AsyncWatcher


Examples of com.alibaba.otter.shared.arbitrate.impl.zookeeper.AsyncWatcher

            path = StagePathUtils.getProcess(getPipelineId(), processId);
            // 2. 监听当前的process列表的变化
            IZkConnection connection = zookeeper.getConnection();
            // zkclient包装的是一个持久化的zk,分布式lock只需要一次性的watcher,需要调用原始的zk链接进行操作
            ZooKeeper orginZk = ((ZooKeeperx) connection).getZookeeper();
            List<String> currentStages = orginZk.getChildren(path, new AsyncWatcher() {

                public void asyncProcess(WatchedEvent event) {
                    MDC.put(ArbitrateConstants.splitPipelineLogFileKey, String.valueOf(getPipelineId()));
                    if (isStop()) {
                        return;
View Full Code Here

Examples of com.alibaba.otter.shared.arbitrate.impl.zookeeper.AsyncWatcher

                            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) {
                                    if (!mutex.state()) { // 避免重复获取lock
                                        acquireLock(mutex);
                                    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.