public static boolean setData(ZKWatcher zkw, String znode, byte[] data, int expectedVersion)
    throws KeeperException, KeeperException.NoNodeException {
    try {
      return zkw.getRecoverableZooKeeper().setData(znode, data, expectedVersion) != null;
    } catch (InterruptedException e) {
      zkw.interruptedException(e);
      return false;
    }
  }
Sets the data of the existing znode to be the specified data. Ensures that the current data has
the specified expected version.
<p>
If the node does not exist, a {@link NoNodeException} will be thrown.
<p>
If their is a version mismatch, method returns null.
<p>
No watches are set but setting data will trigger other watchers of this node.
<p>
If there is another problem, a KeeperException will be thrown.
@param zkw             zk reference
@param znode           path of node
@param data            data to set for node
@param expectedVersion version expected when setting data
@return true if data set, false if version mismatch
@throws KeeperException if unexpected zookeeper exception
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java