public List<String> getServerUris() throws Exception {
    CuratorFramework zkClient = null;
    List<String> serverUris;
    try {
      zkClient = startZookeeperClient(null, false);
      List<String> serverNodes =
              zkClient.getChildren().forPath(ZOOKEEPER_PATH_SEPARATOR + rootNamespace);
      serverUris = new ArrayList<String>(serverNodes.size());
      for (String serverNode : serverNodes) {
        byte[] serverUriBytes = zkClient.getData()
                .forPath(ZOOKEEPER_PATH_SEPARATOR + rootNamespace +
                        ZOOKEEPER_PATH_SEPARATOR + serverNode);
        serverUris.add(new String(serverUriBytes, StandardCharsets.UTF_8));
      }
      zkClient.close();
      return serverUris;
    } catch (Exception e) {
      if (zkClient != null) {
        zkClient.close();
      }
      throw e;
    }
  }
This method is supposed to be called from client code connecting to one of the servers
managed by the configured ZooKeeper. It starts and closes its own ZooKeeper client instead
of using the class member.
@return list of server URIs stored under the configured zookeeper namespace
@throws Exception
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/ZooKeeperHiveHelper.java