/** * 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); }
/** * 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); }
+ " interuppted while waiting for SASL Authentication", e); this.watcher.registerListener(this); try { if (ZKUtil.watchAndCheckExists(watcher, node)) {
public DummyMaster(ZooKeeperWatcher zk, ServerName master) { this.clusterStatusTracker = new ClusterStatusTracker(zk, this); clusterStatusTracker.start(); this.activeMasterManager = new ActiveMasterManager(zk, master, this); zk.registerListener(activeMasterManager); }
/** * 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); }
zk.registerListener(listener);