static void configureConnParams(JdbcConnectionParams connParams) throws ZooKeeperHiveClientException {
    if (isZkHADynamicDiscoveryMode(connParams.getSessionVars())) {
      configureConnParamsHA(connParams);
    } else {
      CuratorFramework zooKeeperClient = null;
      try {
        zooKeeperClient = getZkClient(connParams);

        final List<String> serverHosts = getServerHosts(connParams, zooKeeperClient);

        if (serverHosts.isEmpty()) {
          throw new ZooKeeperHiveClientException("No more HiveServer2 URIs from ZooKeeper to attempt");
        }

        // Pick a server node randomly
        final String serverNode = serverHosts.get(ThreadLocalRandom.current().nextInt(serverHosts.size()));

        updateParamsWithZKServerNode(connParams, zooKeeperClient, serverNode);
      } catch (ZooKeeperHiveClientException zkhce) {
        throw zkhce;
      } catch (Exception e) {
        throw new ZooKeeperHiveClientException("Unable to read HiveServer2 configs from ZooKeeper", e);
      } finally {
        if (zooKeeperClient != null) {
          zooKeeperClient.close();
        }
      }
    }
  }
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