public static boolean createEphemeralNodeAndWatch(ZKWatcher zkw, String znode, byte[] data)
    throws KeeperException {
    boolean ret = true;
    try {
      zkw.getRecoverableZooKeeper().create(znode, data, zkw.createACL(znode), CreateMode.EPHEMERAL);
    } catch (KeeperException.NodeExistsException nee) {
      ret = false;
    } catch (InterruptedException e) {
      LOG.info("Interrupted", e);
      Thread.currentThread().interrupt();
    }
    if (!watchAndCheckExists(zkw, znode)) {
      // It did exist but now it doesn't, try again
      return createEphemeralNodeAndWatch(zkw, znode, data);
    }
    return ret;
  }
Set the specified znode to be an ephemeral node carrying the specified data. If the node is
created successfully, a watcher is also set on the node. If the node is not created
successfully because it already exists, this method will also set a watcher on the node. If
there is another problem, a KeeperException will be thrown.
@param zkw   zk reference
@param znode path of node
@param data  data of node
@return true if node created, false if not, watch set in both cases
@throws KeeperException if unexpected zookeeper exception
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java