gpt4 book ai didi

com.alibaba.wasp.zookeeper.ZooKeeperWatcher.registerListener()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 11:21:38 25 4
gpt4 key购买 nike

本文整理了Java中com.alibaba.wasp.zookeeper.ZooKeeperWatcher.registerListener()方法的一些代码示例,展示了ZooKeeperWatcher.registerListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperWatcher.registerListener()方法的具体详情如下:
包路径:com.alibaba.wasp.zookeeper.ZooKeeperWatcher
类名称:ZooKeeperWatcher
方法名:registerListener

ZooKeeperWatcher.registerListener介绍

[英]Register the specified listener to receive ZooKeeper events.
[中]注册指定的侦听器以接收ZooKeeper事件。

代码示例

代码示例来源:origin: alibaba/wasp

/**
 * Starts the tracking of draining fServers.
 *
 * <p>All Draining RSs will be tracked after this method is called.
 *
 * @throws org.apache.zookeeper.KeeperException
 */
public void start() throws KeeperException, IOException {
 watcher.registerListener(this);
 List<String> servers =
  ZKUtil.listChildrenAndWatchThem(watcher, watcher.drainingZNode);
 add(servers);
}

代码示例来源:origin: alibaba/wasp

/**
 * Starts the tracking of online FServers.
 *
 * <p>
 * All RSs will be tracked after this method is called.
 *
 * @throws org.apache.zookeeper.KeeperException
 * @throws java.io.IOException
 */
public void start() throws KeeperException, IOException {
 watcher.registerListener(this);
 List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher,
   watcher.fsZNode);
 add(servers);
}

代码示例来源:origin: alibaba/wasp

+ " interuppted while waiting for SASL Authentication", e);
this.watcher.registerListener(this);
try {
 if (ZKUtil.watchAndCheckExists(watcher, node)) {

代码示例来源:origin: alibaba/wasp

public DummyMaster(ZooKeeperWatcher zk, ServerName master) {
 this.clusterStatusTracker = new ClusterStatusTracker(zk, this);
 clusterStatusTracker.start();
 this.activeMasterManager = new ActiveMasterManager(zk, master, this);
 zk.registerListener(activeMasterManager);
}

代码示例来源:origin: alibaba/wasp

/**
 * Try becoming active master.
 * 
 * @param startupStatus
 * @return True if we could successfully become the active master.
 * @throws InterruptedException
 */
private boolean becomeActiveMaster(MonitoredTask startupStatus)
  throws InterruptedException {
 this.activeMasterManager = new ActiveMasterManager(zooKeeper,
   this.serverName, this);
 this.zooKeeper.registerListener(activeMasterManager);
 stallIfBackupMaster(this.conf, this.activeMasterManager);
 // The ClusterStatusTracker is setup before the other
 // ZKBasedSystemTrackers because it's needed by the activeMasterManager
 // to check if the cluster should be shutdown.
 this.clusterStatusTracker = new ClusterStatusTracker(getZooKeeper(), this);
 this.clusterStatusTracker.start();
 return this.activeMasterManager.blockUntilBecomingActiveMaster(
   startupStatus, this.clusterStatusTracker);
}

代码示例来源:origin: alibaba/wasp

zk.registerListener(listener);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com