public CuratorFramework startZookeeperClient(ACLProvider zooKeeperAclProvider,
                                               boolean addParentNode) throws Exception {
    CuratorFramework zkClient = getNewZookeeperClient(zooKeeperAclProvider);
    zkClient.start();

    // Create the parent znodes recursively; ignore if the parent already exists.
    if (addParentNode) {
      try {
        zkClient.create()
                .creatingParentsIfNeeded()
                .withMode(CreateMode.PERSISTENT)
                .forPath(ZooKeeperHiveHelper.ZOOKEEPER_PATH_SEPARATOR + rootNamespace);
        LOG.info("Created the root name space: " + rootNamespace + " on ZooKeeper");
      } catch (KeeperException e) {
        if (e.code() != KeeperException.Code.NODEEXISTS) {
          LOG.error("Unable to create namespace: " + rootNamespace + " on ZooKeeper", e);
          throw e;
        }
      }
    }
    return zkClient;
  }
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