/** * 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); }
@Override public void nodeChildrenChanged(final String path) { if(path.equals(watcher.drainingZNode)) { try { final List<String> newNodes = ZKUtil.listChildrenAndWatchThem(watcher, watcher.drainingZNode); add(newNodes); } catch (KeeperException e) { abortable.abort("Unexpected zk exception getting RS nodes", e); } catch (IOException e) { abortable.abort("Unexpected zk exception getting RS nodes", e); } } }