private static void updateParamsWithZKServerNode(JdbcConnectionParams connParams,
      CuratorFramework zooKeeperClient, String serverNode) throws Exception {
    final String zooKeeperNamespace = getZooKeeperNamespace(connParams);
    connParams.setCurrentHostZnodePath(serverNode);
    // Read data from the znode for this server node
    // This data could be either config string (new releases) or server end
    // point (old releases)
    String dataStr =
        new String(
            zooKeeperClient.getData().forPath(ZKPaths.makePath(null, zooKeeperNamespace, serverNode)),
            StandardCharsets.UTF_8);
    // If dataStr is not null and dataStr is not a KV pattern,
    // it must be the server uri added by an older version HS2
    Matcher matcher = kvPattern.matcher(dataStr);
    if ((dataStr != null) && (!matcher.find())) {
      try {
        IPStackUtils.HostPort hostPort = IPStackUtils.getHostAndPort(dataStr);
        connParams.setHost(hostPort.getHostname());
        connParams.setPort(hostPort.getPort());
      } catch (Exception e) {
        throw new ZooKeeperHiveClientException("Unable to parse HiveServer2 URI from ZooKeeper data: " + dataStr);
      }
    } else {
      applyConfs(dataStr, connParams);
    }
  }
Get a list of all HiveServer2 server hosts.

@param connParams The current JDBC connection parameters
@param zooKeeperClient The client to use to connect to ZooKeeper
@return A list of HiveServer2 hosts
@throws ZooKeeperHiveClientException Failed to communicate to ZooKeeper
jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java