gpt4 book ai didi

io.fabric8.zookeeper.utils.ZooKeeperUtils.getAllChildren()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 11:10:40 29 4
gpt4 key购买 nike

本文整理了Java中io.fabric8.zookeeper.utils.ZooKeeperUtils.getAllChildren()方法的一些代码示例,展示了ZooKeeperUtils.getAllChildren()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperUtils.getAllChildren()方法的具体详情如下:
包路径:io.fabric8.zookeeper.utils.ZooKeeperUtils
类名称:ZooKeeperUtils
方法名:getAllChildren

ZooKeeperUtils.getAllChildren介绍

暂无

代码示例

代码示例来源:origin: io.fabric8/fabric-zookeeper

public static List<String> getAllChildren(TreeCache cache, String path) throws Exception {
  List<String> children = getChildren(cache, path);
  List<String> allChildren = new ArrayList<String>();
  for (String child : children) {
    String fullPath = ZKPaths.makePath(path, child);
    allChildren.add(fullPath);
    allChildren.addAll(getAllChildren(cache, fullPath));
  }
  return allChildren;
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

public static List<String> getAllChildren(CuratorFramework curator, String path) throws Exception {
  List<String> children = getChildren(curator, path);
  List<String> allChildren = new ArrayList<String>();
  for (String child : children) {
    String fullPath = ZKPaths.makePath(path, child);
    allChildren.add(fullPath);
    allChildren.addAll(getAllChildren(curator, fullPath));
  }
  return allChildren;
}

代码示例来源:origin: jboss-fuse/fabric8

public static List<String> getAllChildren(CuratorFramework curator, String path) throws Exception {
  List<String> children = getChildren(curator, path);
  List<String> allChildren = new ArrayList<String>();
  for (String child : children) {
    String fullPath = ZKPaths.makePath(path, child);
    allChildren.add(fullPath);
    allChildren.addAll(getAllChildren(curator, fullPath));
  }
  return allChildren;
}

代码示例来源:origin: jboss-fuse/fabric8

public static List<String> getAllChildren(TreeCacheExtended cache, String path) throws Exception {
  List<String> children = getChildren(cache, path);
  List<String> allChildren = new ArrayList<String>();
  for (String child : children) {
    String fullPath = ZKPaths.makePath(path, child);
    allChildren.add(fullPath);
    allChildren.addAll(getAllChildren(cache, fullPath));
  }
  return allChildren;
}

代码示例来源:origin: io.fabric8/fabric-commands

return;
List<String> children = getAllChildren(getCurator(), dir);
Map<String, Map<String,ClusterNode>> clusters = new TreeMap<String, Map<String,ClusterNode>>();
for (String child : children) {

代码示例来源:origin: jboss-fuse/fabric8

private void zkCleanUp(Group<GitNode> group) {
  try {
    RuntimeProperties sysprops = runtimeProperties.get();
    String runtimeIdentity = sysprops.getRuntimeIdentity();
    curator.get().newNamespaceAwareEnsurePath(ZkPath.GIT.getPath()).ensure(curator.get().getZookeeperClient());
    List<String> allChildren = ZooKeeperUtils.getAllChildren(curator.get(), ZkPath.GIT.getPath());
    for (String path : allChildren) {
      String stringData = ZooKeeperUtils.getStringData(curator.get(), path);
      if (stringData.contains("\"container\":\"" + runtimeIdentity + "\"")) {
        LOGGER.info("Found older ZK \"/fabric/registry/clusters/git\" entry for node " + runtimeIdentity);
        ZooKeeperUtils.delete(curator.get(), path);
        LOGGER.info("Older ZK \"/fabric/registry/clusters/git\" entry for node " + runtimeIdentity + " has been removed");
      }
    }
  } catch (KeeperException.NoNodeException ignored) {
  } catch (Exception e) {
    handleException( e);
  }
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com