break; List<String> children = listChildrenAndWatchThem(zkw, node); if (children == null) { continue;
/** * Read the list of children under the archive znode as table names and then sets those tables to * the list of tables that we should archive * @throws KeeperException if there is an unexpected zk exception */ private void updateWatchedTables() throws KeeperException { // get the children and watch for new children LOG.debug("Updating watches on tables to archive."); // get the children and add watches for each of the children List<String> tables = ZKUtil.listChildrenAndWatchThem(watcher, archiveHFileZNode); LOG.debug("Starting archive for tables:" + tables); // if archiving is still enabled if (tables != null && tables.size() > 0) { getMonitor().setArchiveTables(tables); } else { LOG.debug("No tables to archive."); // only if we currently have a tracker, then clear the archive clearTables(); } }
@Override public void nodeChildrenChanged(final String path) { if(path.equals(watcher.getZNodePaths().drainingZNode)) { try { final List<String> newNodes = ZKUtil.listChildrenAndWatchThem(watcher, watcher.getZNodePaths().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); } } } }
/** * Get a list of all the other region servers in this cluster and set a watch * @return a list of server nanes */ private List<String> getRegisteredRegionServers(boolean watch) { List<String> result = null; try { if (watch) { result = ZKUtil.listChildrenAndWatchThem(this.zookeeper, this.zookeeper.getZNodePaths().rsZNode); } else { result = ZKUtil.listChildrenNoWatch(this.zookeeper, this.zookeeper.getZNodePaths().rsZNode); } } catch (KeeperException e) { this.abortable.abort("Get list of registered region servers", e); } return result; } }
/** * Starts the tracking of draining RegionServers. * * <p>All Draining RSs will be tracked after this method is called. * * @throws KeeperException */ public void start() throws KeeperException, IOException { watcher.registerListener(this); // Add a ServerListener to check if a server is draining when it's added. serverManager.registerListener(new ServerListener() { @Override public void serverAdded(ServerName sn) { if (drainingServers.contains(sn)){ serverManager.addServerToDrainList(sn); } } }); List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.getZNodePaths().drainingZNode); add(servers); }
protected void loadAliveClients() throws KeeperException, IOException { aliveClients.clear(); aliveClients.addAll(ZKUtil.listChildrenAndWatchThem(watcher, aliveClientParentPath)); }
/** * List this cluster's peers' IDs * @return list of all peers' identifiers */ public List<String> listPeersIdsAndWatch() { List<String> ids = null; try { ids = ZKUtil.listChildrenAndWatchThem(this.zookeeper, this.peersZNode); } catch (KeeperException e) { this.abortable.abort("Cannot get the list of peers ", e); } return ids; }
/** * List all registered peer clusters and set a watch on their znodes. */ @Override public List<String> getAllPeerIds() { List<String> ids = null; try { ids = ZKUtil.listChildrenAndWatchThem(this.zookeeper, this.peersZNode); } catch (KeeperException e) { this.abortable.abort("Cannot get the list of peers ", e); } return ids; }
/** * Get a list of all the other region servers in this cluster and set a watch * @return a list of server nanes */ private List<String> getRegisteredRegionServers() { List<String> result = null; try { result = ZKUtil.listChildrenAndWatchThem(this.zookeeper, this.zookeeper.rsZNode); } catch (KeeperException e) { this.abortable.abort("Get list of registered region servers", e); } return result; } }
/** * Get a list of all the other region servers in this cluster * and set a watch * @return a list of server nanes */ public List<String> getRegisteredRegionServers() { List<String> result = null; try { result = ZKUtil.listChildrenAndWatchThem( this.zookeeper, this.zookeeper.rsZNode); } catch (KeeperException e) { this.abortable.abort("Get list of registered region servers", e); } return result; }
/** * Starts the tracking of draining RegionServers. * * <p>All Draining RSs will be tracked after this method is called. * * @throws KeeperException */ public void start() throws KeeperException, IOException { watcher.registerListener(this); List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.drainingZNode); add(servers); }
/** * Starts the tracking of draining RegionServers. * * <p>All Draining RSs will be tracked after this method is called. * * @throws 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 RegionServers. * * <p>All RSs will be tracked after this method is called. * * @throws KeeperException * @throws IOException */ public void start() throws KeeperException, IOException { watcher.registerListener(this); List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode); add(servers); }
/** * Starts the tracking of online RegionServers. * * <p>All RSs will be tracked after this method is called. * * @throws KeeperException * @throws IOException */ public void start() throws KeeperException, IOException { watcher.registerListener(this); List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode); add(servers); }
@Override public void nodeChildrenChanged(String path) { if (path.equals(watcher.rsZNode)) { try { List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode); add(servers); } catch (IOException e) { abortable.abort("Unexpected zk exception getting RS nodes", e); } catch (KeeperException e) { abortable.abort("Unexpected zk exception getting RS nodes", e); } } }
@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); } } }
@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); } } } }
@Override public void nodeChildrenChanged(String path) { if (path.equals(watcher.rsZNode) && !server.isAborted() && !server.isStopped()) { try { List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode); add(servers); } catch (IOException e) { server.abort("Unexpected zk exception getting RS nodes", e); } catch (KeeperException e) { server.abort("Unexpected zk exception getting RS nodes", e); } } }
/** * Get a list of all the other region servers in this cluster and set a watch * @return a list of server nanes */ private List<String> getRegisteredRegionServers(boolean watch) { List<String> result = null; try { if (watch) { result = ZKUtil.listChildrenAndWatchThem(this.zookeeper, this.zookeeper.getZNodePaths().rsZNode); } else { result = ZKUtil.listChildrenNoWatch(this.zookeeper, this.zookeeper.getZNodePaths().rsZNode); } } catch (KeeperException e) { this.abortable.abort("Get list of registered region servers", e); } return result; } }
/** * Read the list of children under the archive znode as table names and then sets those tables to * the list of tables that we should archive * @throws KeeperException if there is an unexpected zk exception */ private void updateWatchedTables() throws KeeperException { // get the children and watch for new children LOG.debug("Updating watches on tables to archive."); // get the children and add watches for each of the children List<String> tables = ZKUtil.listChildrenAndWatchThem(watcher, archiveHFileZNode); LOG.debug("Starting archive for tables:" + tables); // if archiving is still enabled if (tables != null && tables.size() > 0) { getMonitor().setArchiveTables(tables); } else { LOG.debug("No tables to archive."); // only if we currently have a tracker, then clear the archive clearTables(); } }