public CuratorFramework getNewZookeeperClient(ACLProvider zooKeeperAclProvider, String nameSpace) {
    LOG.info("Creating curator client with connectString: {} namespace: {} sessionTimeoutMs: {}" +
            " connectionTimeoutMs: {} exponentialBackoff - sleepTime: {} maxRetries: {} sslEnabled: {}",
        quorum, nameSpace,  sessionTimeout,
        connectionTimeout, baseSleepTime, maxRetries, sslEnabled);
    // Create a CuratorFramework instance to be used as the ZooKeeper client.
    // Use the zooKeeperAclProvider, when specified, to create appropriate ACLs.
    CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
            .connectString(quorum)
            .namespace(nameSpace)
            .zookeeperFactory(this.sslZookeeperFactory);
    if (connectionTimeout > 0) {
      builder = builder.connectionTimeoutMs(connectionTimeout);
    }
    if (sessionTimeout > 0) {
      builder = builder.sessionTimeoutMs(sessionTimeout);
    }
    if (maxRetries > 0) {
      builder = builder.retryPolicy(new ExponentialBackoffRetry(baseSleepTime, maxRetries));
    } else {
      // Retry policy is mandatory
      builder = builder.retryPolicy(new RetryOneTime(1000));
    }
    if (zooKeeperAclProvider != null) {
      builder = builder.aclProvider(zooKeeperAclProvider);
    }

    return builder.build();
  }
Adds a server instance to ZooKeeper as a znode.

@throws Exception
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/ZooKeeperHiveHelper.java