本文整理了Java中org.apache.accumulo.server.zookeeper.ZooCache.getChildren()
方法的一些代码示例,展示了ZooCache.getChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooCache.getChildren()
方法的具体详情如下:
包路径:org.apache.accumulo.server.zookeeper.ZooCache
类名称:ZooCache
方法名:getChildren
暂无
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
@Override
public Set<String> listUsers() {
return new TreeSet<>(zooCache.getChildren(ZKUserPath));
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
@Override
public Set<String> listUsers() {
return new TreeSet<String>(zooCache.getChildren(ZKUserPath));
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
@Override
public List<String> getChildren(String path) throws DistributedStoreException {
try {
return cache.getChildren(relative(path));
} catch (Exception ex) {
throw new DistributedStoreException(ex);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
@Override
public List<String> getChildren(String path) throws DistributedStoreException {
try {
return cache.getChildren(relative(path));
} catch (Exception ex) {
throw new DistributedStoreException(ex);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
public synchronized void scanServers() {
try {
final Set<TServerInstance> updates = new HashSet<TServerInstance>();
final Set<TServerInstance> doomed = new HashSet<TServerInstance>();
final String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
HashSet<String> all = new HashSet<String>(current.keySet());
all.addAll(getZooCache().getChildren(path));
locklessServers.keySet().retainAll(all);
for (String server : all) {
checkServer(updates, doomed, path, server);
}
// log.debug("Current: " + current.keySet());
if (!doomed.isEmpty() || !updates.isEmpty())
this.cback.update(this, doomed, updates);
} catch (Exception ex) {
log.error(ex, ex);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
public synchronized void scanServers() {
try {
final Set<TServerInstance> updates = new HashSet<>();
final Set<TServerInstance> doomed = new HashSet<>();
final String path = ZooUtil.getRoot(context.getInstance()) + Constants.ZTSERVERS;
HashSet<String> all = new HashSet<>(current.keySet());
all.addAll(getZooCache().getChildren(path));
locklessServers.keySet().retainAll(all);
for (String zPath : all) {
checkServer(updates, doomed, path, zPath);
}
// log.debug("Current: " + current.keySet());
if (!doomed.isEmpty() || !updates.isEmpty())
this.cback.update(this, doomed, updates);
} catch (Exception ex) {
log.error("{}", ex.getMessage(), ex);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
@Override
public void cleanTablePermissions(String table) throws AccumuloSecurityException {
try {
synchronized (zooCache) {
zooCache.clear();
IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
for (String user : zooCache.getChildren(ZKUserPath))
zoo.recursiveDelete(ZKUserPath + "/" + user + ZKUserTablePerms + "/" + table, NodeMissingPolicy.SKIP);
}
} catch (KeeperException e) {
log.error(e, e);
throw new AccumuloSecurityException("unknownUser", SecurityErrorCode.CONNECTION_ERROR, e);
} catch (InterruptedException e) {
log.error(e, e);
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
@Override
public void cleanTablePermissions(String table) throws AccumuloSecurityException {
try {
synchronized (zooCache) {
zooCache.clear();
IZooReaderWriter zoo = ZooReaderWriter.getInstance();
for (String user : zooCache.getChildren(ZKUserPath))
zoo.recursiveDelete(ZKUserPath + "/" + user + ZKUserTablePerms + "/" + table,
NodeMissingPolicy.SKIP);
}
} catch (KeeperException e) {
log.error("{}", e.getMessage(), e);
throw new AccumuloSecurityException("unknownUser", SecurityErrorCode.CONNECTION_ERROR, e);
} catch (InterruptedException e) {
log.error("{}", e.getMessage(), e);
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
@Override
public void cleanNamespacePermissions(String namespace) throws AccumuloSecurityException {
try {
synchronized (zooCache) {
zooCache.clear();
IZooReaderWriter zoo = ZooReaderWriter.getInstance();
for (String user : zooCache.getChildren(ZKUserPath))
zoo.recursiveDelete(ZKUserPath + "/" + user + ZKUserNamespacePerms + "/" + namespace,
NodeMissingPolicy.SKIP);
}
} catch (KeeperException e) {
log.error("{}", e.getMessage(), e);
throw new AccumuloSecurityException("unknownUser", SecurityErrorCode.CONNECTION_ERROR, e);
} catch (InterruptedException e) {
log.error("{}", e.getMessage(), e);
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server-base
private void updateTableStateCache() {
synchronized (tableStateCache) {
for (String tableId : zooStateCache
.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId
+ Constants.ZTABLE_STATE) != null)
updateTableStateCache(tableId);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-server
private void updateTableStateCache() {
synchronized (tableStateCache) {
for (String tableId : zooStateCache.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE) != null)
updateTableStateCache(tableId);
}
}
内容来源于网络,如有侵权,请联系作者删除!