docs: private void joinCluster() throws InterruptedException, IOException {
          while (true) {
              NodeInfo myInfo;
              try {
                  myInfo = new NodeInfo(NodeState.Fresh.toString(), zk.get().getSessionId());
              } catch (ZooKeeperConnectionException e) {
                  throw ZKException.from(e);
              }
              byte[] encoded = JsonUtil.asJSONBytes(myInfo);
              if (ZKUtils.createEphemeral(zk, "/" + name + "/nodes/" + myNodeID, encoded)) {
                  return;
              } else {
                  Stat stat = new Stat();
                  try {
                      byte[] bytes = zk.get().getData("/" + name + "/nodes/" + myNodeID, false, stat);
                      NodeInfo nodeInfo = JsonUtil.fromJSON(bytes, NodeInfo.class);
                      if(nodeInfo.connectionID == zk.get().getSessionId()) {
                          // As it turns out, our session is already registered!
                          return;
                      }
                  } catch (ZooKeeperConnectionException e) {
                      throw ZKException.from(e);
                  } catch (KeeperException e) {
                      throw ZKException.from(e);
                  }
              }
              LOG.warn("Unable to register with Zookeeper on launch. " +
                      "Is {} already running on this host? Retrying in 1 second...", name);
              Thread.sleep(1000);
          }
      }