in phoenix-queryserver-load-balancer/src/main/java/org/apache/phoenix/queryserver/register/ZookeeperRegistry.java [44:65]
public void registerServer(LoadBalanceZookeeperConf configuration, int pqsPort,
String zookeeperConnectString, String pqsHost)
throws Exception {
this.client = CuratorFrameworkFactory.newClient(zookeeperConnectString,
new ExponentialBackoffRetry(1000,10));
this.client.start();
HostAndPort hostAndPort = HostAndPort.fromParts(pqsHost,pqsPort);
String path = configuration.getFullPathToNode(hostAndPort);
String node = hostAndPort.toString();
this.client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath(path
,node.getBytes(StandardCharsets.UTF_8));
Stat stat = this.client.setACL().withACL(configuration.getAcls()).forPath(path);
if (stat != null) {
LOG.info(" node created with right ACL");
}
else {
LOG.error("could not create node with right ACL. So, system would exit now.");
throw new RuntimeException(" Unable to connect to Zookeeper");
}
}