@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } }));
@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } });
@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } }));
@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } });
@Override public List<IndexerProcess> execute() throws KeeperException, InterruptedException { List<IndexerProcess> indexerProcesses = Lists.newArrayList(); for (String childNode : zk.getChildren(zkBaseNode, false)) { List<String> nodeNameParts = Lists.newArrayList(Splitter.on(',').split(childNode)); if (indexerName.equals(nodeNameParts.get(0))) { byte[] errorBytes = zk.getData(zkBaseNode + "/" + childNode, false, null); IndexerProcess indexerProcess = new IndexerProcess(indexerName, nodeNameParts.get(1), errorBytes == null || errorBytes.length == 0? null : Bytes.toString(errorBytes)); indexerProcesses.add(indexerProcess); } } return indexerProcesses; }}); } catch (Exception e) {
@Override public List<IndexerProcess> execute() throws KeeperException, InterruptedException { List<IndexerProcess> indexerProcesses = Lists.newArrayList(); for (String childNode : zk.getChildren(zkBaseNode, false)) { List<String> nodeNameParts = Lists.newArrayList(Splitter.on(',').split(childNode)); if (indexerName.equals(nodeNameParts.get(0))) { byte[] errorBytes = zk.getData(zkBaseNode + "/" + childNode, false, null); IndexerProcess indexerProcess = new IndexerProcess(indexerName, nodeNameParts.get(1), errorBytes == null || errorBytes.length == 0? null : Bytes.toString(errorBytes)); indexerProcesses.add(indexerProcess); } } return indexerProcesses; }}); } catch (Exception e) {
private void refreshIndexers(List<IndexerModelEvent> events) throws InterruptedException, KeeperException { List<String> indexerNames = zk.getChildren(indexerCollectionPath, watcher); Set<String> indexerNameSet = new HashSet<String>(); indexerNameSet.addAll(indexerNames); // Remove indexers which no longer exist in ZK Iterator<String> currentIndexerNamesIt = indexers.keySet().iterator(); while (currentIndexerNamesIt.hasNext()) { String indexerName = currentIndexerNamesIt.next(); if (!indexerNameSet.contains(indexerName)) { currentIndexerNamesIt.remove(); events.add(new IndexerModelEvent(INDEXER_DELETED, indexerName)); } } // Add/update the other indexers for (String indexerName : indexerNames) { refreshIndexer(indexerName, events); } }
private void refreshIndexers(List<IndexerModelEvent> events) throws InterruptedException, KeeperException { List<String> indexerNames = zk.getChildren(indexerCollectionPath, watcher); Set<String> indexerNameSet = new HashSet<String>(); indexerNameSet.addAll(indexerNames); // Remove indexers which no longer exist in ZK Iterator<String> currentIndexerNamesIt = indexers.keySet().iterator(); while (currentIndexerNamesIt.hasNext()) { String indexerName = currentIndexerNamesIt.next(); if (!indexerNameSet.contains(indexerName)) { currentIndexerNamesIt.remove(); events.add(new IndexerModelEvent(INDEXER_DELETED, indexerName)); } } // Add/update the other indexers for (String indexerName : indexerNames) { refreshIndexer(indexerName, events); } }
List<String> children = zk.getChildren(electionPath, watcher);
List<String> children = zk.getChildren(electionPath, watcher);
List<String> regionServers = zk.getChildren(regionServerPath, false); peers = zk.getChildren(peersPath, false); } catch (KeeperException.NoNodeException e) { logs.addAll(zk.getChildren(hlogsPath, false)); } catch (KeeperException.NoNodeException e) {
List<String> regionServers = zk.getChildren(regionServerPath, false); peers = zk.getChildren(peersPath, false); } catch (KeeperException.NoNodeException e) { logs.addAll(zk.getChildren(hlogsPath, false)); } catch (KeeperException.NoNodeException e) {
try { ZkUtil.deleteNode(zk, basePath + "/hbaseid"); for (String child : zk.getChildren(basePath + "/rs", false)) { ZkUtil.deleteNode(zk, basePath + "/rs/" + child);
try { ZkUtil.deleteNode(zk, basePath + "/hbaseid"); for (String child : zk.getChildren(basePath + "/rs", false)) { ZkUtil.deleteNode(zk, basePath + "/rs/" + child);
List<String> children = Collections.emptyList(); try { children = zk.getChildren(indexerLockPath, false); } catch (KeeperException.NoNodeException e) {
List<String> children = Collections.emptyList(); try { children = zk.getChildren(indexerLockPath, false); } catch (KeeperException.NoNodeException e) {