public ZooKeeperHiveHelper()

in kyuubi-relocated-hive-metastore-client/src/main/java/org/apache/kyuubi/shaded/hive/common/ZooKeeperHiveHelper.java [155:179]


  public ZooKeeperHiveHelper(ZooKeeperHiveHelperBuilder builder) {
    // Get the ensemble server addresses in the format host1:port1, host2:port2, ... . Append
    // the configured port to hostname if the hostname doesn't contain a port.
    String[] hosts = builder.getQuorum().split(",");
    StringBuilder quorumServers = new StringBuilder();
    for (int i = 0; i < hosts.length; i++) {
      quorumServers.append(hosts[i].trim());
      if (!hosts[i].contains(":")) {
        quorumServers.append(":");
        quorumServers.append(builder.getClientPort());
      }

      if (i != hosts.length - 1) {
        quorumServers.append(",");
      }
    }

    this.quorum = quorumServers.toString();
    this.rootNamespace = builder.getServerRegistryNameSpace();
    this.connectionTimeout = builder.getConnectionTimeout();
    this.sessionTimeout = builder.getSessionTimeout();
    this.baseSleepTime = builder.getBaseSleepTime();
    this.maxRetries = builder.getMaxRetries();
    this.zookeeperFactory = new DefaultZookeeperFactory();
  }